Test::...::HiRes(3pm)
π Test::...::HiRes β the manual page bestie π
okay so you're looking at the perl v5.36.0 docs, from the User Contributed Perl Documentation collection, dated 2023-01-22, and the page itself is filed under Test::...::HiRes(3pm). it's giving time-travel but make it Perl. let's get into it β¨
β¨ NAME β¨
Test::MockTime::HiRes β it replaces actual time with simulated high resolution time. yes fr, you get to lie to your own code about what time it is π
π 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;
look at that. sleep 3 but it's instant. main character energy honestly π¦
πΈ DESCRIPTION πΈ
so Test::MockTime::HiRes is a Time::HiRes compatible version of Test::MockTime. that means you can wait milliseconds in simulated time, which is lowkey the whole point π°οΈβ¨
it also gives you mock_time, which lets you restrict the effect of the simulation to just inside a code block. so the fake time stays contained, like a little terrarium of lies π«Ά
π SEE ALSO π
Test::MockTimeTime::HiRes
go read those too bestie, they're the lore π§
π 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. slay, open source, we love to see it π
π AUTHOR π
INA Lintaro <tarao.gnn@gmail.com>
and that's the whole page, no cap. this was rendered from perl v5.36.0 on 2023-01-22 under the Test::...::HiRes(3pm) manual β bye bestie, go mock some time ππ
β¨
π¦ where this page comes from
- debian bookworm: libtest-mocktime-hires-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-mocktime-hires-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-mocktime-hires-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-mocktime-hires-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-mocktime-hires-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms