views:

372

answers:

5

Is there a lightweight process execution timer like Unix's time included with Windows? Sometimes I just want a rough estimate, without having to get out a real profiler. While I could roll my own, I would prefer to use an existing solution.

+2  A: 

You can grab a release of cygwin at cygwin.org - it has many of the commandline tools you find useful on Unix for WIN32.

Chris Kaminski
A: 
    System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
    sw.Start();
    //do your processing
    sw.Stop();

    Console.WriteLine(sw.ElapsedMilliseconds);
scottm
I should have been more clear - I need this for existing binaries.
fatcat1111
well, you can have the code between start and stop run your binary, right? Most programming languages have an equivalent of the stopwatch, and can run other programs.
drhorrible
You're right, I could roll my own (and actually did, before checking out cygwin), but would prefer an existing solution. Doing the above just gives me wallclock times, but the GNU utility has all sorts of data.
fatcat1111
A: 

Ctrl-Alt-Delete: Then Select the "Task Manager" and there is a tab for processes

simon
+1  A: 

You can use procmon or just get 'time' from msys/cygwin

Martin Beckett
I love procmon (and Process Explorer), but this doesn't really meet the requirements as it's completely interactive.
fatcat1111
A: 

I use the timethis tool from the Windows Resource Kit.

Ferruccio