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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Real-Time Counter 1

Status
Not open for further replies.

JAG14

Programmer
Sep 26, 2003
469
0
0
GB
Hi All,

Have designed a small program to log user hours, but I am having problems getting it to count in real-time.
The timer control seems to lapse if the system is busy.
For instance:
Timer Starts at 10:00:00
Timer Ends at 10:05:00
Timer Reads: 00:04:24

Does anybody know how to ensure the counter goes in Real-Time?

Many Thanks in Advance..

jgjge3.gif
[tt]'Very funny, Scotty... Now Beam down my clothes.'[/tt]
 
Can we see some code? What are you counting and how is it started and stopped by your application?
 
Look at using the Time function.

When user starts:

dtUserStart = Time
.
.
.

When user stops:
dtUserEnd = Time

strUserDuration = Format((dtUserEnd - dtUserStart),"hh:nn:ss")

If you're in danger of running over midnight you can use the Date function instead.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
John, works a dream, didn't think of using inbuilt functions. I'm having a bad hair day..

Many Thanx,

jgjge3.gif
[tt]'Very funny, Scotty... Now Beam down my clothes.'[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top