IWeb Posted September 17, 2003 Posted September 17, 2003 Hello, I want to process an operation (e.g. a while loop) for a certain time (in seconds). Is there a function/way in vb.net to count the passed time? I tried to use timevalue.seconds but this return only the seconds from 1 to 60 from the local watch. thank you, Quote
IWeb Posted September 17, 2003 Author Posted September 17, 2003 ok. i developed a working but not good solution: Dim tSpan As TimeSpan Dim tDate As Date Dim interval as integer=10 tDate = Now While tSpan.Seconds < interval tSpan = DateTime.op_Subtraction(DateTime.Now, tDate) End While Quote
*Gurus* Derek Stone Posted September 19, 2003 *Gurus* Posted September 19, 2003 Dim i As Int64 = DateTime.Now.Ticks Dim interval As Int32 = 10000 'Milliseconds While ((DateTime.Now.Ticks - i) <= interval) 'Loop End While Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.