|
-
May 21st, 2007, 09:41 PM
#1
Thread Starter
Addicted Member
Need help re-coding small function, and "Error trapping"
Ok, first off, this code
Code:
Public Function Wait(TimeOut As Long)
Dim TimeNow As Long
TimeNow = timeGetTime()
Do
DoEvents
Loop While TimeNow + TimeOut > timeGetTime()
End Function
(Not my code, etc)
Does a wait function for "TimeOut" Milliseconds, but it also (because of doevents) creates lag (CPU Usage) on the computer its running on.
While this function is only used every now and again, for short periods of time, I was wondering if there was a better way to code this.
I was also wondering if there was a known way of detecting any errors that happen on the system (from any other program), to be specific, the msgbox style ones.. (Does this make sense?)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|