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

本站现有博文332篇,共被浏览882331

本站已经建立2587天!

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