jdk/test/java/lang/ProcessHandle/JavaChild.java
changeset 31539 f850b9d09c91
parent 30899 d2408e757489
child 32209 24bb680a1609
equal deleted inserted replaced
31538:0981099a3e54 31539:f850b9d09c91
   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":