技术栈

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
相关推荐
hboot
1 小时前
AI工程师第二课 - 数据处理
人工智能·python·数据分析
用户835629078051
6 小时前
使用 Python 自动化 PowerPoint 形状布局与格式设置
后端·python
用户835629078051
8 小时前
用 Python 自动化 PowerPoint 演讲者备注添加
后端·python
黄忠
13 小时前
01-系统架构设计-LangGraph状态机与多源异构RAG
python
zzzzzz310
13 小时前
假如我是掘金管理员,我先给评论区装个'代码审查'系统
python·程序员·机器人
砍材农夫
14 小时前
python环境|conda安装和使用(2)
后端·python
程序员龙叔
1 天前
编写高质量 Skill 系列 -- 如何设计需求分析与用例生成的 SKILL
自动化测试·软件测试·python·软件测试工程师·接口测试·性能测试·skill·ai测试
用户835629078051
1 天前
使用 Python 操作 Word 内容控件
后端·python
码云骑士
1 天前
32-慢查询排查全流程(下)-索引优化实战与最左前缀原则
python
热门推荐
012026年6月AI行业全景:从百模大战到Agent元年,这30天发生了什么?022026 年 AI 编程工具终极横评:Cursor vs Claude Code vs Copilot vs Windsurf03【AI】2026 年具身智能模型和世界模型总结042026 AI 编程工具终极实战指南:Cursor vs Claude Code vs Copilot,开发者该怎么选?05GitHub 镜像站点062026年6月AI大模型全景报告:GPT-5.6、Claude Opus 4.8、Gemini 3.5,中美AI三足鼎立谁主沉浮?07Codex 下载安装指南:Windows 和 macOS 官方版下载08AI科技热点日报 | 2026年6月1日09上线仅72小时被强制下架:Claude Fable 5 的短命10HTTP 与 HTTPS 的区别:从原理到实战详解