Test::Time

Latest version: 0.092 registry icon
Maintenance score
0
Safety score
0
Popularity score
6
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
0.092 0 0 0 0 0
0.091 0 0 0 0 0
0.09 0 0 0 0 0

Stability
Latest release:

0.092 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

GPL-1.0-or-later   -   GNU General Public License v1.0 or later

Not a wildcard

Not proprietary

OSI Compliant


Artistic-1.0   -   Artistic License 1.0

Not a wildcard

Not proprietary

OSI Compliant



Actions Status

NAME

Test::Time - Overrides the time() and sleep() core functions for testing

SYNOPSIS

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

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. 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

SEE ALSO

LICENSE

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