Test::Time(3)
π NAME π
Okay so Test::Time is literally the module that overrides the time() and sleep() core functions for testing β and yes, this is the Test::Time(3) page from User Contributed Perl Documentation, bestie π«Ά.
β¨ SYNOPSIS β¨
Hereβs the whole setup, no cap:
use Test::Time;
# Freeze time
my $now = time();
# Increment internal time (returns immediately)
sleep 1;
# Return internal time incremented by 1
my $then = time();
πΈ DESCRIPTION πΈ
Okay so hereβs the tea: Test::Time can be used to test modules that deal with time. Once you use this module, all references to time, localtime and sleep will be internalized. Thatβs the whole vibe β¨.
Need custom time? You can set custom time by passing time => number after the use statement:
use Test::Time time => 1;
my $now = time; # $now is equal to 1
sleep 300; # returns immediately, displaying a note
my $then = time; # $then equals to 301
π AUTHOR π
cho45 <cho45@lowreal.net> β iconic author behavior, fr fr π
.
π¦ SEE ALSO π¦
No entries are listed here β this section is literally empty on this page, bestie π«Ά.
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay, but make it legal β¨.
xoxo, your Unix bestie π
β this page came from perl v5.42.0 and is dated 2022-06-10. Bye bestie! π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Time 0.092-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms