01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: /*
20: * Written by Dawid Kurzyniec and released to the public domain, as explained
21: * at http://creativecommons.org/licenses/publicdomain
22: */
23: package org.apache.openjpa.lib.util.concurrent;
24:
25: /**
26: * Interface to specify custom implementation of precise timer.
27: *
28: * @author Dawid Kurzyniec
29: * @version 1.0
30: */
31: public interface NanoTimer {
32:
33: /**
34: * Returns the current value of the most precise available system timer,
35: * in nanoseconds. This method can only be used to measure elapsed time and
36: * is not related to any other notion of system or wall-clock time. The
37: * value returned represents nanoseconds since some fixed but arbitrary
38: * time(perhaps in the future, so values may be negative). This method
39: * provides nanosecond precision, but not necessarily nanosecond accuracy.
40: * No guarantees are made about how frequently values change. Differences
41: * in successive calls that span greater than approximately 292 years
42: * (263 nanoseconds) will not accurately compute elapsed time due to
43: * numerical overflow.
44: *
45: * @return The current value of the system timer, in nanoseconds.
46: */
47: long nanoTime();
48: }
|