Skip to content

Commit

Permalink
added timer to jobs count
Browse files Browse the repository at this point in the history
  • Loading branch information
checkymander committed Feb 16, 2024
1 parent 98aa74a commit f83314c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Text;
Expand Down Expand Up @@ -38,7 +39,11 @@ public async Task StartTaskAsync(ServerJob job)

public void WaitForNumberOfJobs(int numberOfJobs)
{
while(jobs.Count < numberOfJobs) { }
Stopwatch timer = new Stopwatch();
timer.Start();

while (timer.Elapsed.TotalSeconds < 30 && jobs.Count < numberOfJobs) { };
timer.Stop();
}
}
}

0 comments on commit f83314c

Please sign in to comment.