{"id":"borritomes/restime","name":"restime","scope":"borritomes","platform":"roblox","description":"Mirrored from the Wally registry.","version":"0.1.4","latest":"0.1.4","versions":["0.1.2","0.1.3","0.1.4"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{},"integrity":"71f318eebafd5c27c917147334c77d3ad2ed17ddd53631245d076e7ff6a59e66","likes":0,"downloads":0,"install":"forest install borritomes/restime","url":"https://forest.dev/p/roblox/borritomes/restime","files":"https://api.forest.dev/ai/package/roblox/borritomes/restime/files","readme":"## Introduction\n\nresTime is a library for keeping time loosely based by bevy's Time resource.\n\n## Installation\n\nthere is only one file so you can just copy and paste it or you can install with wally\n```resTime = borritomes/restime@0.1.0```\n\n## How to use\n\nThis is primarily meant as an easy way to keep a virtual time that can be sped up, slowed down or paused.<br>Time is created with `resTime.new()`\n```lua\n    local VirtualTime = resTime.new()\n    local WallTime = resTime.new()\n```\n\nTime needs to be manually incremented with the `Time:Tick()` method\n```lua\n    RunService.stepped:connect(function()\n        VirtualTime:Tick()\n        WallTime:Tick()\n    end)\n```\nYou can get DeltaTime and ElapsedTime like this:\n```lua\n    --everything done with VirtualTime can be done with wall time the only difference is the name\n    local deltaTime = VirtualTime:DeltaTime()\n    local elapsedTime = VirtualTime:ElapsedTime()\n```\nA Time's timescale can be changed by editting `Time.timescale`\n```lua\n    --deltatime is multiplied by timescale internally\n    VirtualTime.timescale = 2.0\n    WallTime.timescale = 1.0 --walltime should usually stay at 1.0\n```\nTime can be freely paused and unpaused\n```lua\n    VirtualTime:Pause()\n    VirtualTime:UnPause()\n```","readmeTruncated":false}