Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question about Time::HiRes

Status
Not open for further replies.

whn

Programmer
Oct 14, 2007
265
US
I am trying to use Time::HiRes.pm and I use Mike's post as a reference:


Code:
# Mike's code
use Time::HiRes qw( clock );
my $clock0 = clock();
[your code here]
my $clock1 = clock();
my $clockd = $clock1 - $clock0;

But I got this error:
Code:
"clock" is not exported by the Time::HiRes module
Can't continue after import errors at tt.pl line 1
BEGIN failed--compilation aborted at tt.pl line 1.

My perl is 5.8.4 on solaris 10. The version of HiRes.pm is 1.59. I noticed that HiRes.pm does not have subroutine clock() implemented. Does it mean this subroutine is no longer used? What's the alternative way then?

Thanks.
 
Have a look at perldoc Time::HiRes for the list of exports and example code.

Annihilannic.
 
if you run time <nameOfProg> it should give you some data as well - might not be as extensive as you need it, but beats loading unnecessary modules.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top