faketime

Build Status Build status

Provides a method unix_time which returns elapsed time since UNIX EPOCH. The returned time can be faked in each thread separately.

Documentation

Quick Start

Add faketime as dependency and use faketime::unix_time or faketime::unix_time_as_millis to get current time.

To fake time in test:

To fake time in child threads:

To fake time of the generated binary, set the environment variable

echo 123456 > /tmp/faketime FAKETIME=/tmp/faketime path/to/binary