my $start = Win32::GetTickCount(); long_function(); my $end = Win32::GetTickCount(); printf("function took %01.3f seconds\n", ($end - $start) /1000);