Can anyone tell the perl script that counts the time when we are online?
Time Counter
Collapse
X
-
when he logs in, start counting the time with:
when he logs out, requests a new webpage, or whatever event you want to measure, count the time with:Code:use Time::HiRes qw(gettimeofday tv_interval); #get better than 1 second resolution $startTime = [gettimeofday]; # starting time
Code:$currentTime = [gettimeofday]; # current time print tv_interval($startTime, $currentTime ); # print elapsed time.
Comment