|sleep||Sleeps for 1/$throttle.|
|alarm||Alarm happens in 1/$throttle.|
These are the knobs on your time machine, but note that it is probably best to adjust them only once: see caveats. For convenience, import() takes will call these methods with each key in its argument list.
perl -MTime::Mock=throttle,600,set,"2009-11-01 00:59" dst_bug.pl
Get or set the throttle.
Get or set the offset.
Set the time to a given value. This may be a numeric time or anything parseable by Date::Parse::str2time() (you need to install Date::Parse to enable this.)
This package remembers the actual system time when it was loaded and makes adjustments from there.
The throttle value will hold across forks, but there is no support for propagating changes to child processes. So, set the knobs only before you fork!
Were only lying about the clock inside of Perl, not magically messing with the universe.
I suggest that you set the knobs at import() and dont mess with them after that unless youre well aware of how your code is using time.
Messing with the throttle during runtime could also give your code the illusion of time going backwards. If your code tries to do math with the return values of time() before and after a slow-down, there could be trouble.
Eric Wilhelm @ <ewilhelm at cpan dot org>
If you found this module on CPAN, please report any bugs or feature requests through the web interface at <http://rt.cpan.org>. I will be notified, and then youll automatically be notified of progress on your bug as I make changes.
If you pulled this development version from my /svn/, please contact me directly.
Copyright (C) 2008 Eric L. Wilhelm, All Rights Reserved.
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||TIME::MOCK (3)||2016-03-17|