#209 [PATCH] Use gettimeofday()

open
None
5
2012-09-07
2008-05-08
No

This patch uses gettimeofday() so that programs under dosbox use accurate real UTC time values.
Useful for logging programs.

Discussion

  • Peter Veenstra
    Peter Veenstra
    2008-05-09

    Logged In: YES
    user_id=535630
    Originator: NO

    hi,

    Well there is in principle nothing wrong with this patch, but it does have a few drawbacks. (we considered using timeofday ourselves a long time ago).
    First of all this breaks the time between emulated bios and dos.
    Secondly using a system call is a bit heavy as certian games call this function a lot. (they use it for timing (yeah some games are odd))
    it has that way the possibility to mess up their internal timing as time might flow faster/slower in dosbox due to various reasons (for example if you pause dosbox, then gettmeofday would still increase the time, but the application will see a jump in the time suddenly))

     
  • Logged In: YES
    user_id=9273
    Originator: YES

    I agree that there are different applications. Some application want virtual time, and some want accurate real time. So, maybe this should be a config file config option, so one could use it on a per dosbox instance basis.