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

本站现有博文311篇,共被浏览742439

本站已经建立2382天!

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