Skip to content

Commit 177f289

Browse files
committed
Formatting
1 parent 559e862 commit 177f289

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/TimeModuleBuiltins.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,34 +182,35 @@ public double time() {
182182
return timeSeconds();
183183
}
184184
}
185-
185+
186186
// time.time_ns()
187-
@Builtin(name = "time_ns", minNumOfPositionalArgs = 0,
188-
doc = "Similar to time() but returns time as an integer number of nanoseconds since the epoch.")
187+
@Builtin(name = "time_ns", minNumOfPositionalArgs = 0, doc = "Similar to time() but returns time as an integer number of nanoseconds since the epoch.")
189188
@GenerateNodeFactory
190189
public abstract static class PythonTimeNsNode extends PythonBuiltinNode {
191190

192191
/**
193-
* The maximum date, which are systems able to handle is 2262 04 11. This
194-
* corresponds to the 64 bit long.
195-
* @return
192+
* The maximum date, which are systems able to handle is 2262 04 11. This corresponds to the
193+
* 64 bit long.
194+
*
195+
* @return
196196
*/
197197
@Specialization
198198
public long time() {
199199
return timeNanoSeconds();
200200
}
201-
201+
202202
@TruffleBoundary
203203
private static long timeNanoSeconds() {
204204
Instant now = Instant.now();
205-
// From java we are not able to obtain the nano seconds resolution. It depends on the jdk
205+
// From java we are not able to obtain the nano seconds resolution. It depends on the
206+
// jdk
206207
// JKD 1.8 the resolution is usually miliseconds (for example 1576081173486000000)
207-
// From JDK 9 including JDK 11 the resolution is usually microseconds (for example 1576082578022393000)
208+
// From JDK 9 including JDK 11 the resolution is usually microseconds (for example
209+
// 1576082578022393000)
208210
// To obtain really nanosecond resulution we have to fake the nanoseconds
209211
return now.getEpochSecond() * 1000000000L + now.getNano();
210212
}
211213
}
212-
213214

214215
// time.monotonic()
215216
@Builtin(name = "monotonic", minNumOfPositionalArgs = 0)
@@ -222,7 +223,7 @@ public double time() {
222223
return System.nanoTime() / 1000000000D;
223224
}
224225
}
225-
226+
226227
// time.monotonic_ns()
227228
@Builtin(name = "monotonic_ns", minNumOfPositionalArgs = 0, doc = "Similar to monotonic(), but return time as nanoseconds.")
228229
@GenerateNodeFactory
@@ -244,11 +245,11 @@ public double counter() {
244245
return (System.nanoTime() - PERF_COUNTER_START) / 1000_000_000.0;
245246
}
246247
}
247-
248+
248249
@Builtin(name = "perf_counter_ns", minNumOfPositionalArgs = 0)
249250
@GenerateNodeFactory
250251
public abstract static class PythonPerfCounterNsNode extends PythonBuiltinNode {
251-
252+
252253
@Specialization
253254
@TruffleBoundary
254255
public long counter() {

0 commit comments

Comments
 (0)