static void Main(string[] args) { th = new Thread(Do); th.IsBackground = true; th.Start(); Do(); th.Join(); double idling = ResourceMap.GetCurrentIdlePercentage(resourceName); double overload = ResourceMap.GetOverloadPercentage(resourceName, 2); double overloadRate = ResourceMap.GetOverloadRate(resourceName); double speed = SpeedMap.GetCurrentSpeed(resourceName); }
private void Animate(AnimationSpeed speed, MovementDirection direction) { _isAnimating = true; var interval = SpeedMap.GetSpeed(speed); if (direction == MovementDirection.Right) { AutoAnimationSpeed = -AutoAnimationSpeed; } _timer = new System.Windows.Forms.Timer { Interval = interval }; VarZ = AutoAnimationSpeed; _timer.Tick += (s, a) => ResetZ(0); _timer.Start(); }
private static void Do() { MetricsConsoleWriter.Start(); for (int i = 0; i < 400; i++) { using (PerformanceMeter root = new PerformanceMeter("root", String.Empty)) { SpeedMap.IncrementCounter(resourceName, i); Process(i, root); using (new PerformanceMeter("Sleep", root)) { Thread.Sleep(5); } if (i % 3 == 0) { using (new PerformanceMeter("Process 2", root)) { Process2(); } } } } }