コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
        public static bool IsBlacklisted(string name)
        {
            lock (blacklisted)
            {
                GTimer t = null;
                if (!blacklisted.TryGetValue(name, out t))
                {
                    return(false);
                }

                return(!t.IsReady());
            }
        }
コード例 #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");
     }
 }
コード例 #5
0
 public long Peek()
 {
     return((long)((double)(GTimer.smethod_0() - this.method_0()) / (double)this.method_2() * 10000.0));
 }
コード例 #6
0
 public void Reset()
 {
     this.method_1(GTimer.smethod_0());
 }
コード例 #7
0
 public GTimer(double countDowntime)
 {
     this.countDownTime = countDowntime;
     this.method_3(GTimer.smethod_1());
     this.Reset();
 }
コード例 #8
0
 public GTimer()
 {
     this.countDownTime = 0.0;
     this.method_3(GTimer.smethod_1());
     this.Reset();
 }