简体   繁体   English

执行时间java程序

[英]Execution time java program

First of all, here's just something I'm curious about 首先,这只是我很好奇的事情

I've made a little program which fills some templates with values and I noticed that every time I run it the execution time changes a little bit, it ranges from 0.550s to 0.600s. 我编写了一个小程序,用一些值填充了一些模板,并且我注意到,每次运行它时,执行时间都会有所变化,范围从0.550s到0.600s。 My CPU is running at 2.9GHZ if that could be useful. 我的CPU的运行速度为2.9GHZ(如果有用)。

The instructions are always the same, is it maybe something that has to do with physics or something more software oriented? 指示始终是相同的,这可能与物理有关还是与软件有关?

it has to do with java running on a virtual machine; 它与在虚拟机上运行的Java有关; even ac program might run different times slightly longer/shorter, also the operating system steers when a program has resources (cpu time, memory …) to be executed. 即使是ac程序,其运行时间可能稍长/短,操作系统也会在程序具有要执行的资源(cpu时间,内存等)时进行引导。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM