{"id":18674063,"url":"https://github.com/nervosnetwork/faketime","last_synced_at":"2025-07-09T07:08:06.588Z","repository":{"id":51253871,"uuid":"162599215","full_name":"nervosnetwork/faketime","owner":"nervosnetwork","description":"Provides a method unix_time which returns elapsed time since UNIX EPOCH. The returned time can be faked in each thread separately.","archived":false,"fork":false,"pushed_at":"2021-05-19T02:12:22.000Z","size":28,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-09T07:04:29.655Z","etag":null,"topics":["rust","test","time"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nervosnetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-20T15:41:35.000Z","updated_at":"2024-11-03T14:58:50.000Z","dependencies_parsed_at":"2022-09-18T04:21:23.525Z","dependency_job_id":null,"html_url":"https://github.com/nervosnetwork/faketime","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/nervosnetwork/faketime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaketime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaketime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaketime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaketime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nervosnetwork","download_url":"https://codeload.github.com/nervosnetwork/faketime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ffaketime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264411146,"owners_count":23603802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","test","time"],"created_at":"2024-11-07T09:17:23.323Z","updated_at":"2025-07-09T07:08:06.565Z","avatar_url":"https://github.com/nervosnetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# faketime\n\n[![Build Status](https://travis-ci.com/nervosnetwork/faketime.svg?branch=master)](https://travis-ci.com/nervosnetwork/faketime)\n[![Build status](https://ci.appveyor.com/api/projects/status/h7t1uxnbag13rvv6?svg=true)](https://ci.appveyor.com/project/doitian/faketime)\n\nProvides a method `unix_time` which returns elapsed time since _UNIX EPOCH_.\nThe returned time can be faked in each thread separately.\n\n[Documentation](https://docs.rs/faketime)\n\n## Quick Start\n\nAdd faketime as dependency and use `faketime::unix_time` or\n`faketime::unix_time_as_millis` to get current time.\n\nTo fake time in test:\n\n- Use `faketime::millis_tempfile` to create a temp timestamp file.\n- Enable faketime via `faketime::enable` in current thread.\n\nTo fake time in child threads:\n\n- Use `faketime::millis_tempfile` to create a temp timestamp file.\n- Set child thread name to `FAKETIME=PATH`, where PATH is the path to the\ntimestamp file.\n\nTo fake time of the generated binary, set the environment variable\n\n```\necho 123456 \u003e /tmp/faketime\nFAKETIME=/tmp/faketime path/to/binary\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Ffaketime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnervosnetwork%2Ffaketime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Ffaketime/lists"}