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); }
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); }
public static bool IsBlacklisted(string name) { lock (blacklisted) { GTimer t = null; if (!blacklisted.TryGetValue(name, out t)) { return(false); } return(!t.IsReady()); } }
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"); } }
public long Peek() { return((long)((double)(GTimer.smethod_0() - this.method_0()) / (double)this.method_2() * 10000.0)); }
public void Reset() { this.method_1(GTimer.smethod_0()); }
public GTimer(double countDowntime) { this.countDownTime = countDowntime; this.method_3(GTimer.smethod_1()); this.Reset(); }
public GTimer() { this.countDownTime = 0.0; this.method_3(GTimer.smethod_1()); this.Reset(); }