473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Time Counter

Can anyone tell the perl script that counts the time when we are online?
May 19 '10 #1
1 2722
chaarmann
785 Expert 512MB
when he logs in, start counting the time with:
Expand|Select|Wrap|Line Numbers
  1. use Time::HiRes qw(gettimeofday tv_interval); #get better than 1 second resolution
  2. $startTime = [gettimeofday]; # starting time
when he logs out, requests a new webpage, or whatever event you want to measure, count the time with:
Expand|Select|Wrap|Line Numbers
  1. $currentTime = [gettimeofday]; # current time
  2. print tv_interval($startTime, $currentTime ); # print elapsed time.
  3.  
May 19 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rahmi Acar | last post by:
Can any one redirect me to the place where i can find the stuff i need? Im by the way adding net time protocol so it will syncronise by it's own intergated watch. This is a start stopp application...
7
by: Patrick Kowalzick | last post by:
Dear all, I just wondered if it is possible to count the number of classes created via a template class at compile time. To show what I mean I post an example, which is not working but carries...
6
by: fb | last post by:
I am tring to print an array of 100 elements in a grid like pattern. ex: +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000 +0000...
0
by: Earl Anderson | last post by:
KB Article Q140908 provided the following function to create an Auto Incrementing Counter: Function Next_Custom_Counter () On Error GoTo Next_Custom_Counter_Err Dim MyDB As Database Dim...
26
by: Pravesh | last post by:
Hi: is there a way to get current system time in milliseconds... which functions and headers?? thanks pravesh
28
by: Yannick Loth | last post by:
Hello I'm writing a program which needs to pause exactly some microseconds then go ahead. I'v tried the nanosleep() function but this is not much precise. I also tried it with raising the...
2
by: GTDriver | last post by:
I would like to know if there is function in VB.NET that returns the date and time someone last turned on/off the computer? I'm more interested in knowing this on a non-networked computer. Maybe...
3
by: Ethan Strauss | last post by:
Hi, There have been quite a few discussions of Random not giving random numbers and how to fix that by feeding in a new seed each time, waiting enough time, or calling the Next() method of the...
3
blackstormdragon
by: blackstormdragon | last post by:
Here were our instructions: "My mother always took a little red counter to the grocery store. The counter was used to keep tally of the amount of money she would have spent so far on that visit to...
3
by: Yamasassy | last post by:
Hi im having even more problems i have run time error 9 Subscript out of range i can just use print #1 txtFullname.Text but i think this is wrong for my assignemt as i supposed ot use a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.