An interface for getting the current value of a high-resolution time source, in nanoseconds.
Clocks other than NanoClock are typically used only for testing.
This interface is required in addition to Java 8's Clock, because nanoTime is required to
compare values with io.grpc.CallOptions.getDeadlineNanoTime().
Methods
millisTime()
publicabstractlongmillisTime()
Returns the current value of this clock's high-resolution time source, in milliseconds.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-01 UTC."],[[["This webpage documents the `ApiClock` interface across multiple versions, spanning from version 2.1.2 to the latest version 2.46.1."],["The `ApiClock` interface provides methods for retrieving the current time in both milliseconds (`millisTime()`) and nanoseconds (`nanoTime()`)."],["The `ApiClock` interface is used to compare time values, specifically with `io.grpc.CallOptions.getDeadlineNanoTime()`, using a high-resolution time source."],["The latest version of `ApiClock` is 2.46.1, found under the \"2.46.1 (latest)\" link, which is the most up to date release of this api."],["While most clocks are only used for testing, `NanoClock` is an exception to this rule."]]],[]]