I want to run an interactive simulation and have time pass at 12x real time. There is more than one solution to this, but is there a way to make the server clock run 12x faster?
Asked
Active
Viewed 2,589 times
3 Answers
2
Related question here (although Java-based). Even if you could speed the system clock up you'd break various of things (logging, timestamps on files, time-based kernel stuff to name but three) so it would seem better if your code could be made independent of "real" time.
Perhaps you could invent a new unit of time, equal to 1/12 of a second, and code your app in terms of that?
1
I suppose a script that changes the clock (starting waaaay back) and every second adds +12 seconds won't be good, will it? Somewhat I suspect the application is not using gettimeofday, but has an internal counter and timers. What simulation is that?

lorenzog
- 2,799
- 3
- 20
- 24
-
It will be a django system with people trading with each other. Can fudge it, but just wondering if it's possible to make the server solve the problem. – user19196 Nov 25 '09 at 21:12
-
Must admit no familiarity with Django trading systems :) I suspect it would not help, since it involves other peers (do you plan to adjust their clock as well?). Again, sorry for not being of much help - best thing would be tweaking the simulation for that purpose, assuming it's possible at all. – lorenzog Nov 25 '09 at 22:08
-
It does seem possible to tweek the clock - see adjtime - but maybe not advisable! – user19196 Nov 26 '09 at 10:19
0
-
This looks fun and will play with it - but am heading advice of answer above that warns of all the things I'll screw up if I mess with the click. Still if I use an new Amazon instance for each test that wouldn't matter.... Thanks for finding this. – user19196 Nov 26 '09 at 10:18
-
`adjtime` is not that helpful in your case, because it applies its changes over a long period of time. It's more suited to sync'ing the system clock to an external time source. – slowpoison Oct 03 '13 at 22:55