Skip to content

Commit 9db71d4

Browse files
authored
chore: Replaces System.currentTimeMillis by nanoTime (#8989)
1 parent 88aa5b2 commit 9db71d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dd-trace-core/src/main/java/datadog/trace/common/writer/TraceProcessingWorker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ private void maybeTracePostProcessing(List<DDSpan> trace) {
254254
final SpanPostProcessor postProcessor = SpanPostProcessor.Holder.INSTANCE;
255255
try {
256256
final long timeout = Config.get().getTracePostProcessingTimeout();
257-
final long deadline = System.currentTimeMillis() + timeout;
257+
final long deadline = System.nanoTime() + timeout * 1000 * 1000;
258258
final boolean[] timedOut = {false};
259259
final BooleanSupplier timeoutCheck =
260260
() -> {
261261
if (timedOut[0]) {
262262
return true;
263263
}
264-
if (System.currentTimeMillis() > deadline) {
264+
if (System.nanoTime() > deadline) {
265265
timedOut[0] = true;
266266
}
267267
return timedOut[0];

0 commit comments

Comments
 (0)