public static void Spawn(MulticastDelegate f) { var sw = Stopwatch.StartNew(); var e = new WaitExecution(CurrentScript, (LuaThread)LuaThread.running().Values[0], 0, () => f.FastDynamicInvoke(sw.Elapsed.TotalSeconds, Game.Workspace.DistributedGameTime)); ExecutionQueue.Enqueue(e); }
public static double Wait(double seconds) { seconds = Math.Max(seconds, LuaSettings.DefaultWaitTime); var sw = Stopwatch.StartNew(); var e = new WaitExecution(CurrentScript, (LuaThread)LuaThread.running().Values[0], seconds); ExecutionQueue.Enqueue(e); YieldThread(); return(sw.Elapsed.TotalSeconds); }