Exemplo n.º 1
0
        private static long smethod_1()
        {
            long result = 0L;

            if (GTimer.QueryPerformanceFrequency(ref result) == 0)
            {
                throw new NotSupportedException("Error while querying the performance counter frequency.");
            }
            return(result);
        }
Exemplo n.º 2
0
        private static long smethod_0()
        {
            long result = 0L;

            if (GTimer.QueryPerformanceCounter(ref result) == 0)
            {
                throw new NotSupportedException("Error while querying the high-resolution performance counter.");
            }
            return(result);
        }
Exemplo n.º 3
0
        public static bool IsBlacklisted(string name)
        {
            lock (blacklisted)
            {
                GTimer t = null;
                if (!blacklisted.TryGetValue(name, out t))
                {
                    return(false);
                }

                return(!t.IsReady());
            }
        }
Exemplo n.º 4
0
 public static void Blacklist(string name, int howlongSeconds)
 {
     lock (blacklisted)
     {
         GTimer t = null;
         if (blacklisted.TryGetValue(name, out t))
         {
             blacklisted.Remove(name);
         }
         t = new GTimer(howlongSeconds * 1000);
         blacklisted.Add(name, t);
         Logger.Log("Blacklisted " + name + " for " + howlongSeconds + "s");
     }
 }
Exemplo n.º 5
0
 public long Peek()
 {
     return((long)((double)(GTimer.smethod_0() - this.method_0()) / (double)this.method_2() * 10000.0));
 }
Exemplo n.º 6
0
 public void Reset()
 {
     this.method_1(GTimer.smethod_0());
 }
Exemplo n.º 7
0
 public GTimer(double countDowntime)
 {
     this.countDownTime = countDowntime;
     this.method_3(GTimer.smethod_1());
     this.Reset();
 }
Exemplo n.º 8
0
 public GTimer()
 {
     this.countDownTime = 0.0;
     this.method_3(GTimer.smethod_1());
     this.Reset();
 }