Forum C# Good way to implement timer?

Good way to implement timer?

Postby Vania » April 20th, 2010, 8:28 pm

Hey there,

I need to execute a function once every 100ms.
Anyone knows how to do that in the server?

I tried with System.Timers.Timer but its not allowed.

Thank you.
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm

Re: Good way to implement timer?

Postby Vania » April 20th, 2010, 8:34 pm

Nevermind, I just found how to do it.
It's in the example bounce server.

Code: Select all
// This is how you setup a timer
AddTimer(delegate {
       // code here will code every 100th millisecond (ten times a second)
}, 25);
Vania
 
Posts: 198
Joined: March 24th, 2010, 9:01 pm


Return to C#