技术栈

python统计秒数

换个名字就很好2023-09-21 8:25

code

1.没有cuda的版本

复制代码
import time

s = time.time()
for i in range(100):
	pass
t = time.time()
print("time:{} sec".format(t-s))

2.cuda 同步

复制代码
torch.cuda.synchronize()
start = time.time()
result = model(input)
torch.cuda.synchronize()
end = time.time()

ref

https://blog.csdn.net/qq_36268040/article/details/100085263

上一篇:【OpenSSL】VC编译OpenSSL
下一篇:初识ElasticSearch
相关推荐
赵民勇
17 分钟前
Python 协程详解与技巧总结
python
极光代码工作室
28 分钟前
基于YOLO目标检测的智能监控系统
python·深度学习·yolo·机器学习·计算机视觉
江华森
1 小时前
Python 进阶编程实战 — 从多版本环境到百万级登录系统
python
C+-C资深大佬
1 小时前
python while循环
服务器·开发语言·python
zh路西法
2 小时前
【现代控制理论与卡尔曼滤波】从状态空间到Python仿真实现
开发语言·python
Vodka~
3 小时前
WSL2 + RViz GPU渲染机械臂
人工智能·python
8Qi8
3 小时前
hello-agents学习笔记--Memory让Agent拥有记忆
人工智能·python·llm·agent·ai编程·vibecoding
Esaka_Forever
3 小时前
Python 完整内存管理机制详解
开发语言·python·spring
Weigang
4 小时前
用 LlamaIndex 做 RAG 前,先把 Reader、Index、Retriever 的边界写清楚
人工智能·python·开源
热门推荐
01GitHub 镜像站点022026 年 AI 编程工具终极横评:Cursor vs Claude Code vs Copilot vs Windsurf03AI科技热点日报 | 2026年07月01日04【AI】2026 年具身智能模型和世界模型总结052026 AI 编程工具终极实战指南:Cursor vs Claude Code vs Copilot,开发者该怎么选?062026 年 AI 大模型 & AI 编程工具实战全总结072026年6月AI大模型全景报告:GPT-5.6、Claude Opus 4.8、Gemini 3.5,中美AI三足鼎立谁主沉浮?08Claude Code、Codex、Cursor三分天下:2026年AI编程Agent生态全景剖析09Agnes AI 免费 API 接入指南:文本、生图、生视频,一套接口全免费102026 国产 AI 大模型横评:DeepSeek、通义千问、Kimi、文心一言、星火、豆包谁更能打?