3 ms·
And the most foolproof way would be to run in a virtual machine or a prepared container. Pretty fast too. Having a clock cgroup would be easier and more useful
by AstralStorm 10y ago
And the most foolproof way would be to run in a virtual machine or a prepared container. Pretty fast too.
Having a clock cgroup would be easier and more useful than you'd think. Also, you can play tricks like ntpd does in a container. (e.g. adjtime)
- aray 10y agoThis depends on the virtual machine or container! Ironically, because the folks working on containers/VMs are _really_ good at what they do, time access calls in particular have been really optimized (they get called a lot). This makes it very hard to intercept time calls at this layer! e.g. KVM and LXC both essentially hand time calls straight to the host. This means time intercepts at the VM/container layer need fundamental support (I mentioned affine time transformation in the linux kernel in another comment) which doesn't work for people who need to deploy on current hosted container.
- MayeulC 10y agoAccording to Wikipedia, there is a proposed time namespace. Controlled time warping could be a useful feature there. A proposal should be made, if that's not part of the planned features.