diff -r 0981099a3e54 -r f850b9d09c91 jdk/test/java/lang/ProcessHandle/JavaChild.java --- a/jdk/test/java/lang/ProcessHandle/JavaChild.java Thu Jul 09 10:37:07 2015 +0300 +++ b/jdk/test/java/lang/ProcessHandle/JavaChild.java Thu Jul 09 09:55:36 2015 -0400 @@ -281,12 +281,12 @@ sendResult(action, Integer.toString(millis)); break; case "cpuloop": - long times = Long.valueOf(args[nextArg++]); - Instant end = Instant.now().plusMillis(times); - while (Instant.now().isBefore(end)) { - // burn the cpu til the time is up + long cpuMillis = Long.valueOf(args[nextArg++]); + long cpuTarget = getCpuTime() + cpuMillis * 1_000_000L; + while (getCpuTime() < cpuTarget) { + // burn the cpu until the time is up } - sendResult(action, times); + sendResult(action, cpuMillis); break; case "cputime": sendResult(action, getCpuTime());