MCPcopy Create free account
hub / github.com/dsg-titech/simblock / runTask

Method runTask

simulator/src/main/java/simblock/simulator/Timer.java:108–120  ·  view source on GitHub ↗

Runs a ScheduledTask.

()

Source from the content-addressed store, hash-verified

106 * Runs a {@link ScheduledTask}.
107 */
108 public static void runTask() {
109 // If there are any tasks
110 if (taskQueue.size() > 0) {
111 // Get the next ScheduledTask
112 ScheduledTask currentScheduledTask = taskQueue.poll();
113 Task currentTask = currentScheduledTask.getTask();
114 currentTime = currentScheduledTask.getScheduledTime();
115 // Remove the task from the mapping of all tasks
116 taskMap.remove(currentTask, currentScheduledTask);
117 // Execute
118 currentTask.run();
119 }
120 }
121
122 /**
123 * Remove task from the mapping of all tasks and from the execution queue.

Callers 1

mainMethod · 0.80

Calls 3

getTaskMethod · 0.95
getScheduledTimeMethod · 0.95
runMethod · 0.95

Tested by

no test coverage detected