Use NTimer to Display How Long a Program Takes to Execute

By | 2007-04-14

When developing applications or testing scripts in Windows XP, it may prove beneficial to benchmark how much time it takes for the particular code to execute. Perhaps you need to test different sorting or cache file management algorithms to learn which one is quickest. You may want to record how long it takes website analysis software to parse server log files. For these and other purposes you can use the Windows XP ntimer command.

The ntimer command displays detailed information on elapsed time, user mode time, kernel mode time, and privileged mode time. As the help file states, the timing is only accurate up to the resolution of the computer”s internal timer, which on x86-based machines is to the tenth of a second.

To use the ntimer command, you”ll need to first download and install the Windows 2003 Resource Kit.

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.