MCPcopy Create free account
hub / github.com/antlr/codebuff / remainingNanos

Method remainingNanos

output/java_guava/1.4.17/Monitor.java:998–1006  ·  view source on GitHub ↗

Returns the remaining nanos until the given timeout, or 0L if the timeout has already elapsed. Caller must have previously sanitized timeoutNanos using toSafeNanos.

(long startTime, long timeoutNanos)

Source from the content-addressed store, hash-verified

996 */
997
998 private static long remainingNanos(long startTime, long timeoutNanos) {
999 // assert timeoutNanos == 0L || startTime != 0L;
1000
1001 // TODO : NOT CORRECT, BUT TESTS PASS ANYWAYS!
1002 // if (true) return timeoutNanos;
1003 // ONLY 2 TESTS FAIL IF WE DO:
1004 // if (true) return 0;
1005 return (timeoutNanos <= 0L) ? 0L : timeoutNanos - (System.nanoTime() - startTime);
1006 }
1007
1008 /**
1009 * Signals some other thread waiting on a satisfied guard, if one exists.

Callers 4

enterMethod · 0.95
enterWhenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected