简体   繁体   English

在Windows 64位中对python程序的CPU时间进行基准测试

[英]Benchmarking the CPU time of a python program in Windows 64-bit

I need to get the CPU run time of my python application. 我需要获取python应用程序的CPU运行时间。

How to measure execution time of command in windows command line? 如何在Windows命令行中测量命令的执行时间?

I came across the above thread earlier and learned about timeit. 我较早地遇到了上述线程,并了解了timeit。 However, according to the download website, timeit is not supported in 64-bit Windows. 但是,根据下载网站,在64位Windows中不支持timeit。

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17657#top http://www.microsoft.com/download/zh-CN/details.aspx?displaylang=en&id=17657#top

time.clock() does not give CPU time in Windows. 在Windows中,time.clock()不提供CPU时间。

Is there any easy way to get the CPU time of my python application? 有没有简单的方法来获取我的python应用程序的CPU时间?

If you're doing this just to profile or benchmark your code, don't building your own, use a built in library. 如果您这样做只是为了配置代码或对代码进行基准测试,请不要构建自己的代码,而应使用内置库。

http://docs.python.org/library/profile.html http://docs.python.org/library/profile.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM