Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
VB.NET General Discussion
Using a For/Next loop to 'kill time'
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="JohnH, post: 46762, member: 5139"] Timer is also unreliable in the run, if system is busy it will skip a second every now and then, at least that's what I have experienced. To overcome this you can save the starting DateTime (Date.Now) and loop until any current Date.Now subtracting the start is around the TimeSpan targeted. Example: [CODE]Sub timeout(ByVal seconds As Integer) Dim start As Date = Date.Now Do Until Date.Now.Subtract(start).Seconds >= seconds Application.DoEvents() Threading.Thread.Sleep(500) Loop End Sub [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
VB.NET General Discussion
Using a For/Next loop to 'kill time'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom