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

本站现有博文329篇,共被浏览858788

本站已经建立2567天!

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