Timer
by Levi Putna · in Torque X 2D · 10/27/2007 (9:26 pm) · 2 replies
Is there an easy way to call a function after an amount of time bas passed?
E.g
TimeSpan delay = TimeSpan.FromSeconds(3);
elapseTime(delay,someFunction());
with delay being the amount of time and someFunction() being the function to call after the time has passed.
I want to have a 3 second delay between finishing one level and loading another.
I currently have a rather complicated while loop doing the job.
Thanks in advance.
E.g
TimeSpan delay = TimeSpan.FromSeconds(3);
elapseTime(delay,someFunction());
with delay being the amount of time and someFunction() being the function to call after the time has passed.
I want to have a 3 second delay between finishing one level and loading another.
I currently have a rather complicated while loop doing the job.
Thanks in advance.
Associate John Kanalakis
EnvyGames
public void MyScheduledFunction(object sender, ScheduledEventArguments scheduleEventArguments) { //DO SOMETHING }Next, schedule the call into MyScheduledFunction for some future time, say 3 seconds (or 3000 ms).
That should do it...
John K.