code: public static long getNanoTime() {
          Object token = ThreadIdentityManager.runAsServer();
          try {
              return AccessController.doPrivileged( new PrivilegedAction<Long>() {
                  @Override
                  public Long run() {
                      return System.nanoTime();
                  }
              } ).longValue();
          } finally {
              ThreadIdentityManager.reset(token);
          }
      }
docs: Run {@link System#getNanoTime} as a privileged action.
  
  @return The system time in nano-seconds.