Test::MockTime::HiRes - Replaces actual time with simulated high resolution time
use Test::MockTime::HiRes qw(mock_time); my $now = time; mock_time { time; # == $now; sleep 3; # returns immediately time; # == $now + 3; usleep $microsecond; } $now;
Test::MockTime::HiRes is a Time::HiRes compatible version of Test::MockTime. You can wait milliseconds in simulated time.
Test::MockTime::HiRes
It also provides mock_time to restrict the effect of the simulation in a code block.
mock_time
Test::MockTime
Time::HiRes
Copyright (C) INA Lintaro
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
INA Lintaro <tarao.gnn@gmail.com>
To install Test::MockTime::HiRes, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::MockTime::HiRes
CPAN shell
perl -MCPAN -e shell install Test::MockTime::HiRes
For more information on module installation, please visit the detailed CPAN module installation guide.