-
Install the DevKit and add it's artifacts to your
PATH
C:\w32time-git>\DevKit\devkitvars.bat Adding the DevKit to PATH...
-
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
-
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
-
Test it
C:\>timer echo Hello Ruby! Hello Ruby! real 0.052 system 0.015 user 0.000
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