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

本站现有博文327篇,共被浏览828335

本站已经建立2534天!

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