computer help index
 
 
Search:
"Offering free computer help, hints, and tips to the Internet populace." Now with over 3,360 tips!

Windows XP and DOS

Use NTimer to Display How Long a Program Takes to Execute

SUMMARY: Benchmark how long it takes a process to run under Windows XP from the DOS prompt.

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.

The ntimer command supports the following command-line options:

-1
Display output on one line, suppressing some of the information

-f
Displays process page faults, total system interrupts, context switches, and system calls

-s
Allows you to time a server process - press CONTROL+C in the DOS prompt window to get the current timing information.

program name and parameters
REQUIRED - The program name to execute and any required command-line parameters.

Example:

The following example would run the "parselogs" application and show how much time it took to execute. Note that "parselogs" is a fictional command.

ntimer parselogs

The output may look something like this:

ContextSwitches - 34181
First level fills = 0
Second level fills = 0

ETime( 0:00:18.196 ) UTime( 0:00:00.600 ) KTime( 0:00:09.894 )
ITime( 0:00:06.909 )

 

 
Add: Del.icio.us | Digg | Furl | My Yahoo!
 

Discuss This Tip

Print This Tip

Get E-Mail When New Tips are Online

Return to the Windows XP and DOS page.


More in MalekTips:
Internet Explorer 7 MiscWindows Vista - ExplorerGoogle Image Search



Change Cache SizeCopy File or Folder Path to DOS Prompt or Windows AppSearch for Images in Various Sizes

RSS Feeds - Subscribe!
 

You want the latest tech tips and tricks in your e-mail Inbox - FREE? Type your e-mail address below and click 'Subscribe'.
 



( sample / details ) ( opt-out instructions )
 


 Free Offer! - Subscribe to the MalekTips computer help list and be one of the first to get new computer tips, articles, and download links! ( privacy policy )  ( opt-out instructions )
This page and its contents are copyright
©1997 - 2008 Envision Programming. ( copyright/disclaimer )

Home | Free Computer Help Newsletter! | Windows | Web Development | DOS and Batch Files | Removing Spyware
Digital Camera and Photography | Computer and Internet | Software | Microsoft Word
Computer Articles | About | Contribute a Tip | Link To Us! | Computer and Technology Links
RSS Feeds |  Contact Us | Advertising | Privacy Policy | Computer Help Forums