File: README.md

package info (click to toggle)
libtest-mocktime-hires-perl 0.08-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 124 kB
  • sloc: perl: 97; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 1,102 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[![Build Status](https://travis-ci.org/tarao/perl5-Test-MockTime-HiRes.svg?branch=master)](https://travis-ci.org/tarao/perl5-Test-MockTime-HiRes)
# NAME

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

# 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;

# DESCRIPTION

`Test::MockTime::HiRes` is a [Time::HiRes](https://metacpan.org/pod/Time::HiRes) compatible version of
[Test::MockTime](https://metacpan.org/pod/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.

# SEE ALSO

[Test::MockTime](https://metacpan.org/pod/Test::MockTime)

[Time::HiRes](https://metacpan.org/pod/Time::HiRes)

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

# AUTHOR

INA Lintaro <tarao.gnn@gmail.com>