gpt4 book ai didi

java - -XX :+UseGetTimeOfDay as a parameter do? 是什么意思

转载 作者:行者123 更新时间:2023-11-30 05:09:35 24 4
gpt4 key购买 nike

在开发 Java 应用程序时,我在 java 命令上遇到了 -XX:+UseGetTimeOfDay 参数,但我找不到有关它的太多信息。

首先,-XX 是什么意思,UseGetTimeOfDay 会提供什么?我以前没有见过这些,我想知道它们的作用,它可能是我的应用程序特有的东西,还是这些标准的 Java 参数?

最佳答案

我不知道它现在是否仍然相关,但我发现了 some documentation关于它:

Instructs the JVM to use the GetTimeOfDay call instead of the mechanism used in earlier versions whereby the number of cpu ticks since the application started is used to calculate the current time. With this new mechanism, changes to the system date or time using date(1), adjtime(2), or time synchronization utilities such as ntp are not reflected in the date and time that Java™ returns, until the process is restarted. If your application requires that Java™ immediately reflects such system time changes, you can use the -XX:+UseGetTimeOfDay option, however you may notice a drop in performance.

一般来说,-X 和 -XX 标志是控制 JVM 的标志(并且是特定于 VM 的)。

来自HotSpot options page (其中没有列出这个):

  • Options that begin with -X are non-standard (not guaranteed to be supported on all VM implementations), and are subject to change without notice in subsequent releases of the JDK.
  • Options that are specified with -XX are not stable and are not recommended for casual use. These options are subject to change without notice.

关于java - -XX :+UseGetTimeOfDay as a parameter do? 是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3922150/

24 4 0