in reply to Re: Equivalent of GetTickCount() in perl?
in thread Equivalent of GetTickCount() in perl?

Had no luck (unrecognized sub) w/Perl 5.12, Time::HiRes -- but this code merely needs conversion of seconds to milliseconds:
"use Time::HiRes qw(gettimeofday);$t0=gettimeofday();print \"Seconds M +iliseconds: $t0\";" Seconds Miliseconds: 1320179894.348 <c>perl -MTime::HiRes -e"print $Time::HiRes::VERSION;" 1.9724 perl -v This is perl 5, version 12, subversion 3 (v5.12.3) built for MSWin32-x +86-multi-thread (with 9 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry Wall Binary build 1204 [294330] provided by ActiveState http://www.ActiveSt +ate.com Built Feb 9 2011 14:38:22

Replies are listed 'Best First'.
Re^3: Equivalent of GetTickCount() in perl?
by GrandFather (Saint) on Nov 02, 2011 at 00:02 UTC

    Odd. The following works fine for me with and ActiveState install of Perl 5.10.1 on Windows 7:

    use warnings; use strict; use Time::HiRes; my ($epochSecs, $epochUSecs) = Time::HiRes::gettimeofday (); print "$epochSecs $epochUSecs $Time::HiRes::VERSION";

    Prints:

    1320191917 602197 1.9724

    and worked for version 1.9719 of Time::HiRes too.

    True laziness is hard work