PC Review


Reply
Thread Tools Rate Thread

checking elapsed seconds

 
 
Bert
Guest
Posts: n/a
 
      14th Jan 2008
I'd like to assign the current time + 10 seconds to variable, TriggerTime.
Then I'll compare TriggerTime with the current time later in a code loop,
and if the current time is greater, then branch to other code. Seems as
though this should be simple, but I'm not getting it.
Thanks.
Bert


 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      14th Jan 2008
Sub time_it()
MsgBox (Time + 10)
End Sub

later compare to Time
--
Gary''s Student - gsnu200765


"Bert" wrote:

> I'd like to assign the current time + 10 seconds to variable, TriggerTime.
> Then I'll compare TriggerTime with the current time later in a code loop,
> and if the current time is greater, then branch to other code. Seems as
> though this should be simple, but I'm not getting it.
> Thanks.
> Bert
>
>
>

 
Reply With Quote
 
heraldine
Guest
Posts: n/a
 
      14th Jan 2008
Try this:-

Sub TimeTest()

Dim dbl10Sec As Double
Dim TriggerTime As Double

dbl10Sec = TimeSerial(0, 0, 10)
TriggerTime = Time + dbl10Sec

If TimeTrigger > Time Then
MsgBox Time & " - " & Format(TriggerTime, "hh:mm:ss")
End If

End Sub

James
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Elapsed GPS seconds between two struct tm times? Ray Mitchell Microsoft VC .NET 1 6th Sep 2009 08:55 PM
Elapsed Time in Hours, Minutes and Seconds Timothy.Rybak@gmail.com Microsoft Excel Programming 1 2nd Mar 2006 07:45 PM
Re: how to calculate seconds elapsed between two moments? RagDyeR Microsoft Excel Discussion 0 26th Aug 2005 10:35 AM
how to find Seconds elapsed ? .... Prabhu Microsoft C# .NET 1 29th Jan 2004 02:30 PM
Convert Elapsed Time to Seconds fred14214 Microsoft Access Form Coding 0 6th Sep 2003 07:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:17 PM.