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

本站现有博文323篇,共被浏览795239

本站已经建立2493天!

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