3 ms·
See also libfaketime, which does all this and more besides: https://github.com/wolfcw/libfaketime https://github.com/wolfcw/libfaketime
by jonty 14y ago
See also libfaketime, which does all this and more besides: https://github.com/wolfcw/libfaketime https://github.com/wolfcw/libfaketime
- majke 14y agolibfaketime is very cool, but I think it does something different. It focuses on, well, faking time. Fluxcapacitor makes blocking syscalls exit immediately, faking time is a necessary side effect. For example the docs of libfaketime say: LD_PRELOAD=./libfaketime.so.1 FAKETIME="+1,5y x10,0" \ /bin/bash -c 'while true; do echo $SECONDS ; sleep 1 ; done' For each second that the endless loop sleeps, the executed bash shell will think that 10 seconds have passed While with fluxcapacitor the sleep will exit immediately, not after 1s: $ time ./fluxcapacitor --libpath=. -- \ bash -c 'for i in 1 2 3 4 5 ; do sleep 1; done' real 0m0.279s