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

Timer question 1

Status
Not open for further replies.

shawnnason

Programmer
Jun 12, 2001
26
US
All -

I want to see how long it's been since I started a timer until an event happens. Is there way to do something along the lines of:

Code:
timer1.interval = 10000
timer1.enabled = true

<other stuff happens>

timer1.enabled = false
leftovertime = timer1.timeleft
text1.text (leftovertime)

Or do I need to do something crazy like make my interval really small, then each time the interval expires add to a counter, then report the counter?

I know there is no such thing as timleft for a timer.

- Shawn
 
Shawn -

I'd do something like this:
[tt]
Dim StartTime as date
DIm RunTime as date

Starttime = Now()

'... Do stuff

RunTime = Now() - Starttime
[/tt]

 
chiph -

That's fine idea, but I need to be able to measure in milliseconds. Now() olny give me seconds. Any other ideas?

- Shawn
 
Figured it out:

Code:
StartTime = Timer

<things happen>

FinishTime = Timer
Totaltime = FinishTime - StartTime
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top