Abstract: This article discusses in detail several functions, gettickcount, queryperformancecounter, and rdtsc, that measure the running time of a program on a Windows platform, and provides sample code.There are many evaluation indicators for the Quality of algorithms. One of the important indicators is the time complexity. If the two programs complete the same task, that is, they have the same functions a
When you run a complex Python program, the execution time is long, and you might want to improve the execution efficiency of your program. But what should we do?
First, there is a tool that detects bottlenecks in your code, for example, to find out which part of the execution time is longer. Next, it is optimized for this part.
At the same time, you need to control memory and
When running a complex Python program, it can take a long time to execute, and you may want to increase the execution efficiency of your program. But what should we do?
First, there is a tool that can detect bottlenecks in your code, for example, to find out which part of the execution time is relatively long. Next, optimize for this section.
At the same time, you need to control memory and
This article mainly introduces 10 methods for detecting Python program running time, CPU usage, and memory usage, including using the Python decorator or external UnixShell commands, for more information about how to run complex Python programs, it may take a long time. in this case, you may want to improve the program execution efficiency. But what should we do?
1 tick = 0.0001 ms
As can be seen in this example, the gap between the two is large, for the following reasons:
1 Windows is a multitasking operating system that allocates CPU time polling on a per-thread basis. That is, a program running halfway, may be stripped of CPU resources for other programs to run.
2 The program
can be, general offline debugging, can be used WinDbg ADPlus.vbs generate dump file, the command is as follows: Adplus-hang-o d:\dump-p 1234, where hang means attaching to the process, if it is-crash, then the target process crashes, and the parameter after-o indicates that the dump file is placed in the description location , the number after-P is the PID of the process, or it can be-PN followed by the process name. In my use of the process, Win7 system, with ADPlus crawl w3wp process old fail
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.