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

本站现有博文321篇,共被浏览770766

本站已经建立2457天!

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