#! perl -slw use strict; use Win32::API::Prototype; ApiLink( 'kernel32', q[ BOOL QueryPerformanceCounter( LARGE_INTEGER *lpPerformanceCount ) ]) or die $^E; ApiLink( 'kernel32', q[ BOOL QueryPerformanceFrequency( LARGE_INTEGER *lpPerformanceCount ) ]) or die $^E; sub int64_to_NV { my( $lo, $hi ) = unpack 'VV', $_[ 0 ]; return $hi * 2**32 + $lo; } my $frequency = ' ' x 10; QueryPerformanceFrequency( $frequency ) or die $^E; print 'Counter changes ', int64_to_NV( $frequency ), ' times/second'; for ( 1 .. 10 ) { QueryPerformanceCounter( $frequency )or die $^E; print int64_to_NV( $frequency ); } __END__ P:\test>375475 Counter changes 3579545 times/second 699092440218 699092440527 699092440794 699092441059 699092441312 699092441566 699092441820 699092442073 699092442322 699092442576