コード例 #1
0
ファイル: Benchmark.cs プロジェクト: warrenfalk/lucenenet
 /// <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();
     }
 }
コード例 #2
0
ファイル: Benchmark.cs プロジェクト: sean-gilliam/lucenenet
 /// <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();
     }
 }
コード例 #3
0
 /// <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);
     }
 }