public void runNewSimulation(long totalSimulationTimeMs, int numThreads, int numTasks, long minBurstTimeMs, long maxBurstTimeMs, long sleepTimeMs) { code example
Example: public void runNewSimulation(long totalSimulationTimeMs, int numThreads, int numTasks, long minBurstTimeMs, long maxBurstTimeMs, long sleepTimeMs) {
public static void main(String args[]) {
final long rngSeed = 00000000;
MultithreadedService service = new MultithreadedService();
final int numSimulations = 3;
final long totalSimulationTimeMs = 15*1000L;
final int numThreads = 4;
final int numTasks = 30;
final long minBurstTimeMs = 1*1000L;
final long maxBurstTimeMs = 10*1000L;
final long sleepTimeMs = 100L;
for (int i = 0; i < numSimulations; i++) {
System.out.println("Running simulation #" + i);
service.runNewSimulation(totalSimulationTimeMs,
numThreads, numTasks,
minBurstTimeMs, maxBurstTimeMs, sleepTimeMs);
System.out.println("Simulation results:"
+ "\n" + "----------------------");
service.printResults();
System.out.println("\n");
}
System.out.println("----------------------");
System.out.println("Exiting...");