logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Test::MockTime::HiRes - Replaces actual time with simulated high resolution time

Author

       INA Lintaro <tarao.gnn@gmail.com>

perl v5.36.0                                       2023-01-22                         Test::MockTime::HiRes(3pm)

Description

       "Test::MockTime::HiRes" is a Time::HiRes compatible version of Test::MockTime.  You can wait milliseconds
       in simulated time.

       It also provides "mock_time" to restrict the effect of the simulation in a code block.

License

       Copyright (C) INA Lintaro

       This library is free software; you can redistribute it and/or modify it under the same terms as Perl
       itself.

Name

       Test::MockTime::HiRes - Replaces actual time with simulated high resolution time

See Also

       Test::MockTime

       Time::HiRes

Synopsis

           use Test::MockTime::HiRes qw(mock_time);

           my $now = time;
           mock_time {
               time;    # == $now;

               sleep 3; # returns immediately

               time;    # == $now + 3;

               usleep $microsecond;
           } $now;

See Also