Skip to content
Command line utility to measure process running and CPU times
Branch: master
Clone or download
Pull request Compare This branch is 7 commits ahead, 5 commits behind larsch:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build and install it

  1. Install the DevKit and add it's artifacts to your PATH

     Adding the DevKit to PATH...
  2. Update the Makefile for your needs. For example, rename the exe and add it to a directory already on your PATH

     C:\w32time-git>vim Makefile
     # mod to this: cp w32time.exe C:\tools\timer.exe
  3. Build and install it

     C:\w32time-git>make install
     gcc -O2 -o w32time.exe -Wall w32time.c
     w32time.c: In function 'main':
     w32time.c:109:7: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'DWORD' [-Wformat]
     w32time.c:118:7: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'DWORD' [-Wformat]
     strip -s w32time.exe
     cp w32time.exe C:\tools\timer.exe
  4. Test it

     C:\>timer echo Hello Ruby!
     Hello Ruby!
     real    0.052
     system  0.015
     user    0.000

Use it

C:\>timer ruby -ve "10_000_000.times { |i| i**3 }
ruby 1.9.3p0 (2011-11-08 revision 33661) [i386-mingw32]
real    9.079
system  0.015
user    9.048

C:\>timer \jruby\bin\jruby.exe -ve "10_000_000.times { |i| i**3 }
jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (Java HotSpot(TM) Client VM 1.7.0_01) [Windows 7-x86-java]
real    5.304
system  0.202
user    5.054

C:\>timer lua -e "for i = 0,10000000 do r=i^3 end"
real    1.185
system  0.000
user    1.170
You can’t perform that action at this time.