equal
deleted
inserted
replaced
279 int millis = Integer.valueOf(args[nextArg++]); |
279 int millis = Integer.valueOf(args[nextArg++]); |
280 Thread.sleep(millis); |
280 Thread.sleep(millis); |
281 sendResult(action, Integer.toString(millis)); |
281 sendResult(action, Integer.toString(millis)); |
282 break; |
282 break; |
283 case "cpuloop": |
283 case "cpuloop": |
284 long times = Long.valueOf(args[nextArg++]); |
284 long cpuMillis = Long.valueOf(args[nextArg++]); |
285 Instant end = Instant.now().plusMillis(times); |
285 long cpuTarget = getCpuTime() + cpuMillis * 1_000_000L; |
286 while (Instant.now().isBefore(end)) { |
286 while (getCpuTime() < cpuTarget) { |
287 // burn the cpu til the time is up |
287 // burn the cpu until the time is up |
288 } |
288 } |
289 sendResult(action, times); |
289 sendResult(action, cpuMillis); |
290 break; |
290 break; |
291 case "cputime": |
291 case "cputime": |
292 sendResult(action, getCpuTime()); |
292 sendResult(action, getCpuTime()); |
293 break; |
293 break; |
294 case "out": |
294 case "out": |