Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
 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();
                 }
             }
         }
     }
 }