EADST

Python: Set Code Running Time

Set code running time, if time out, stop running.

import time
import eventlet
eventlet.monkey_patch()
with eventlet.Timeout(3, False):  # Running Time <= 3s
    time.sleep(2)
    print("Sleep 2 seconds")
    time.sleep(2)
    print("Sleep 2 more seconds")
print("Finish Testing")

相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
Clash Transformers LLAMA Tracking diffusers GoogLeNet Heatmap tqdm Pytorch Ptyhon Ubuntu Data LeetCode Web 顶会 Django Bert VPN Rebuttal Git TTS git FastAPI llama.cpp Windows 报税 Qwen2 FP64 版权 Gemma Distillation Algorithm Numpy 多进程 printf torchinfo transformers InvalidArgumentError WAN mmap SQLite Augmentation VGG-16 RAR 关于博主 Video tar ResNet-50 TensorRT 证件照 uWSGI Zip 财报 v0.dev Password CLAP 公式 Bin 搞笑 CSV Bipartite 多线程 OCR GGML Translation BeautifulSoup WebCrawler CV SVR Tensor Python Bitcoin 域名 HaggingFace RGB 阿里云 XML Baidu scipy Quantization FP16 签证 Pillow 图标 Shortcut 算法题 EXCEL SQL UNIX 强化学习 净利润 飞书 Diagram News Llama GPTQ CAM Tiktoken Permission Miniforge LaTeX Template DeepStream Logo FP32 图形思考法 NLP PyTorch ChatGPT logger Hilton Excel Plate Color PDF CUDA UI TSV Paper 递归学习法 Jetson Interview Firewall Mixtral Attention 继承 Website Freesound CEIR API 第一性原理 hf Crawler Linux Paddle CTC Animate Card QWEN Search BTC Anaconda VSCode Agent Pickle Proxy SPIE Claude 云服务器 Base64 FP8 IndexTTS2 Github Conda CC DeepSeek ModelScope OpenAI Qwen2.5 Sklearn uwsgi LLM Land git-lfs Review BF16 Input Hungarian Cloudreve GIT COCO FlashAttention NameSilo Math OpenCV Use 音频 Safetensors Breakpoint Domain SAM Jupyter Hotel Vmess Knowledge Dataset XGBoost HuggingFace LoRA JSON C++ PyCharm NLTK icon PIP Qwen Docker Datetime Disk TensorFlow Plotly PDB Food Streamlit Google Statistics Quantize Markdown MD5 Michelin GPT4 AI Magnet Pandas v2ray Random ONNX YOLO Image2Text 腾讯云 Nginx Vim
站点统计

本站现有博文324篇,共被浏览809124

本站已经建立2512天!

热门文章
文章归档
回到顶部