Skip to content
Discussion options

You must be logged in to vote

@zakkak Thanks, it can work now that i modified it like this.

  private static long startNanoTime = 0;
  private static long startNano = 0;

  public static long nano() {
    if (startNanoTime == 0) {
      startNanoTime = System.currentTimeMillis() * 1_000_000;
    }
    if (startNano == 0) {
      startNano = System.nanoTime();
    }
    return startNanoTime + System.nanoTime() - startNano;
  }

Maybe the reason

When native image build done, the startNano and startNanoTime never change, and then CurremtTime.nano() the func exec System.nanoTime() that initial value change everytime

But this is my guess, after all, the native docker image can be work in my local.
Anyway, at least it can …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@seepine
Comment options

@zakkak
Comment options

zakkak Dec 5, 2023
Collaborator

@seepine
Comment options

Answer selected by seepine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants