/// <summary> /// Execute this benchmark. /// </summary> public virtual void Execute() { lock (this) { if (executed) { throw new InvalidOperationException("Benchmark was already executed"); } executed = true; runData.SetStartTimeMillis(); algorithm.Execute(); } }
/// <summary> /// Execute this benchmark. /// </summary> public virtual void Execute() { lock (this) { if (executed) { throw IllegalStateException.Create("Benchmark was already executed"); } executed = true; runData.SetStartTimeMillis(); algorithm.Execute(); } }
/// <summary> /// Execute this benchmark. /// </summary> public virtual void Execute() { UninterruptableMonitor.Enter(this); try { if (executed) { throw IllegalStateException.Create("Benchmark was already executed"); } executed = true; runData.SetStartTimeMillis(); algorithm.Execute(); } finally { UninterruptableMonitor.Exit(this); } }