Exemplo n.º 1
0
 public RunningTask(string name, ulong id, int timeoutSeconds)
 {
     this.name           = name;
     this.id             = id;
     this.timeoutSeconds = timeoutSeconds;
     timer = new NmkdStopwatch();
 }
Exemplo n.º 2
0
        // Benchmark a void method (via Action)
        public static void BenchmarkMethod(string methodName, Action method, params object[] args)
        {
            NmkdStopwatch sw = new NmkdStopwatch();

            method.DynamicInvoke(args);
            Logger.Log($"Ran {methodName} in {sw}", true);
        }
Exemplo n.º 3
0
        // Benchmark a method with return type (via Delegate/Func)
        public static object BenchmarkMethod(string methodName, Delegate method, params object[] args)
        {
            NmkdStopwatch sw        = new NmkdStopwatch();
            var           returnVal = method.DynamicInvoke(args);

            Logger.Log($"Ran {methodName} in {sw}", true);
            return(returnVal);
        }