includeos/IncludeOS

Returning time taken

tweekley49 opened this issue · 1 comments

Trying to get the time it takes for a program to run, but having no luck within the simulator. First image is the program being ran in IncludeOS and second image is showing results when ran outside IncludeOS. Any ideas why the timer isn't working inside IncludeOS?

Screenshot from 2019-10-14 10-32-23
Screenshot from 2019-10-14 10-33-24

Thanks!

So, there are some problems with our timers. If you are running in a VM without hardware acceleration (no Intel VMX or Amd SVM) then the OS will have to be emulated inside Qemu (and other hypervisors), and everything becomes unpredictable to say the least.

We also have a KVMCLOCK implementation that has issues on google cloud, so we disabled it, but those timers are the most high precision outside of actual instruction counting.

Now, should you find yourself with hardware accelerated VM, I would use cycle counting almost always. For that you can use os::nanos_since_boot() etc.