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

本站现有博文340篇,共被浏览1019218次

本站已经建立2719天!

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