예제 #1
0
파일: Util.cs 프로젝트: geckosoft/OpenRA
        public static IActivity RunActivity( Actor self, IActivity act )
        {
            while( act != null )
            {
                var prev = act;

                var sw = new Stopwatch();
                act = act.Tick( self );
                var dt = sw.ElapsedTime();
                if(dt > Game.Settings.Debug.LongTickThreshold)
                    Log.Write("perf", "[{2}] Activity: {0} ({1:0.000} ms)", prev, dt * 1000, Game.LocalTick);

                if( prev == act )
                    break;
            }
            return act;
        }