Use NTimer to Display How Long a Program Takes to Execute

Posted On 2007-04-14 by FortyPoundHead
Tags: Tip Windows XP
Views: 1610

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.

About the Author

has posted a total of 1974 articles.

Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Code Links