|
-
Oct 26th, 2007, 06:36 PM
#1
Thread Starter
Member
[RESOLVED]Need help delaying code execution
hello, i was wondering...
how do i suspend code execution for a few milliseconds when using a backgroundworker?
Code:
private void Core_DoWork(object sender, DoWorkEventArgs e)
{
uint iTime=0;
int iLoop = 0;
while (iLoop == 0)
{
if (FMODSound != null)
{
FMODChannel.getPosition(ref iTime, FMOD.TIMEUNIT.MS);
SetTime((int)iTime / 1000);
}
//need something to suspend the code for a bout 500ms
//{EDIT}
//I had to manually put using System.Threading; and make a call
//to:
System.Threading.Thread.Sleep(500);
}
}
thanks for any help
nevermind, i figured it out, thanks tho
Last edited by nci; Oct 26th, 2007 at 08:31 PM.
Reason: Solved
-
Oct 30th, 2007, 07:51 AM
#2
Re: [RESOLVED]Need help delaying code execution
 Originally Posted by nci
nevermind, i figured it out, thanks tho
Please post your resolution as it might help someone else with the same question.
Thanks.
-
Oct 30th, 2007, 09:34 AM
#3
Thread Starter
Member
Re: [RESOLVED]Need help delaying code execution
oh, sorry, i used the edit and added it in my original post, but here it is
Code:
//need something to suspend the code for a bout 500ms
//{EDIT}
//I had to manually put using System.Threading; and make a call
//to:
System.Threading.Thread.Sleep(500);
i just had to add using System.Threading and call
System.Threading.Thread.Sleep(500);
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
|