{"_id":"@colyseus/clock","_rev":"6-55e4cab051ab9bc4b8552a9f95c1b34f","name":"@colyseus/clock","dist-tags":{"latest":"2.0.3"},"versions":{"1.0.0":{"name":"@colyseus/clock","version":"1.0.0","keywords":["clock","ticker","delta","time"],"author":{"name":"Endel Dreyer","email":"endel.dreyer@gmail.com"},"license":"MIT","_id":"@colyseus/clock@1.0.0","maintainers":[{"name":"endel","email":"endel.dreyer@gmail.com"}],"homepage":"https://github.com/colyseus/clock#readme","bugs":{"url":"https://github.com/colyseus/clock/issues"},"dist":{"shasum":"8adbe8b01e87b783334d32a019a74fb07eaf5dd7","tarball":"https://registry.npmjs.org/@colyseus/clock/-/clock-1.0.0.tgz","fileCount":8,"integrity":"sha512-x1un5rFEgilVAA6ukSG8GFgtpX/hsmL5BtrPdxLx0dbPU7zwpTVXez2qoGza7YYS5QTvVD45gbHyX/KaaEWSZQ==","signatures":[{"sig":"MEQCIBNPs0JyvsUpNqKvH/G2NHVbMi2Y3YUsI9ss2Vj7MZ6mAiBeL734gigAd2HUrUM7JSxQ4E+dEF8kDL73Y+m6Z1wDXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9656},"main":"./build/index.js","module":"./build/index.mjs","exports":{".":{"import":"./build/index.mjs","require":"./build/index.js"}},"gitHead":"9d414bc66ce7cd695fd100dcd124a499a6faedb0","scripts":{"test":"npm run prepublish && mocha test","build":"tsc --emitDeclarationOnly && node build.mjs","prepublishOnly":"npm run build"},"typings":"./build/index.d.ts","_npmUser":{"name":"endel","email":"endel.dreyer@gmail.com"},"repository":{"url":"git://github.com/colyseus/clock.git","type":"git"},"_npmVersion":"10.2.4","description":"A simple clock/ticker implementation to track elapsed/delta time.","directories":{},"_nodeVersion":"20.11.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^2.3.3","assert":"^1.3.0","esbuild":"^0.23.0","fast-glob":"^3.3.2","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/clock_1.0.0_1721313007238_0.7516559246292576","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@colyseus/clock","version":"1.0.1","keywords":["clock","ticker","delta","time"],"author":{"name":"Endel Dreyer","email":"endel.dreyer@gmail.com"},"license":"MIT","_id":"@colyseus/clock@1.0.1","maintainers":[{"name":"endel","email":"endel.dreyer@gmail.com"}],"homepage":"https://github.com/colyseus/clock#readme","bugs":{"url":"https://github.com/colyseus/clock/issues"},"dist":{"shasum":"dc476a2aba3fad8c56c70977aba4300e14658894","tarball":"https://registry.npmjs.org/@colyseus/clock/-/clock-1.0.1.tgz","fileCount":8,"integrity":"sha512-HLovmkerzZ7aEckKuHFnql+sXCChi37WRc88duWxufiH5wVMNomBjlqQYVxaORgA+4vLIRd0/jabu6DAbkSfaA==","signatures":[{"sig":"MEQCIG2xvfl2vU43JgPTHJiPLXwnd9X2Ik7B21axqzAMzRWEAiA/wsECa346lrhHoWK20obbcNjgOuumGTsAOTL5adbfiw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9693},"main":"./build/index.js","module":"./build/index.mjs","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.mjs","require":"./build/index.js"}},"gitHead":"89ac5f13fb93829a79803e93a704aa6e7ce0b084","scripts":{"test":"npm run prepublish && mocha test","build":"tsc --emitDeclarationOnly && node build.mjs","prepublishOnly":"npm run build"},"typings":"./build/index.d.ts","_npmUser":{"name":"endel","email":"endel.dreyer@gmail.com"},"repository":{"url":"git://github.com/colyseus/clock.git","type":"git"},"_npmVersion":"10.9.3","description":"A simple clock/ticker implementation to track elapsed/delta time.","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^2.3.3","assert":"^1.3.0","esbuild":"^0.23.0","fast-glob":"^3.3.2","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/clock_1.0.1_1760733268536_0.7573959457143666","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@colyseus/clock","version":"2.0.0","keywords":["clock","ticker","delta","time"],"author":{"name":"Endel Dreyer","email":"endel.dreyer@gmail.com"},"license":"MIT","_id":"@colyseus/clock@2.0.0","maintainers":[{"name":"endel","email":"endel.dreyer@gmail.com"}],"homepage":"https://github.com/colyseus/clock#readme","bugs":{"url":"https://github.com/colyseus/clock/issues"},"dist":{"shasum":"3265cc873e53a843b737bfdfb6ac86470345b559","tarball":"https://registry.npmjs.org/@colyseus/clock/-/clock-2.0.0.tgz","fileCount":8,"integrity":"sha512-7IdJxoZaqETT6OuqpfzDfA8bbfj5s4QPN8BXT0IlV3nXHfCM9yWrwwNT4oI6HEitjvEBIou4mbcUpHyJzCa0Vw==","signatures":[{"sig":"MEUCIQDJiEahsr9oNnPvdU2HH54Lj1MbFbuPpH+NGapdD4okPwIgSgJaGMNmkpSrENIrPAnf1ioKFxpr9DBEuP8HAmuPNio=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9771},"main":"./build/index.js","type":"module","module":"./build/index.mjs","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.mjs","require":"./build/index.js"}},"gitHead":"6ee4b96f5f24f39e723d51bf25b13c69b250132d","scripts":{"test":"mocha test","build":"tsc --emitDeclarationOnly && node build.mjs","prepublishOnly":"npm run build"},"typings":"./build/index.d.ts","_npmUser":{"name":"endel","email":"endel.dreyer@gmail.com"},"repository":{"url":"git://github.com/colyseus/clock.git","type":"git"},"_npmVersion":"10.9.3","description":"A simple clock/ticker implementation to track elapsed/delta time.","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^2.3.3","assert":"^1.3.0","esbuild":"^0.23.0","fast-glob":"^3.3.2","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/clock_2.0.0_1767904814946_0.44932896032538716","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@colyseus/clock","version":"2.0.1","keywords":["clock","ticker","delta","time"],"author":{"name":"Endel Dreyer","email":"endel.dreyer@gmail.com"},"license":"MIT","_id":"@colyseus/clock@2.0.1","maintainers":[{"name":"endel","email":"endel.dreyer@gmail.com"}],"homepage":"https://github.com/colyseus/clock#readme","bugs":{"url":"https://github.com/colyseus/clock/issues"},"dist":{"shasum":"1d7adb45d7e677eecb0ea7f4d28b173758a50df6","tarball":"https://registry.npmjs.org/@colyseus/clock/-/clock-2.0.1.tgz","fileCount":8,"integrity":"sha512-oWFPpjn9SJdBCftjLepQNoo+OisCunRkB5AehMbBtwlmpb0VFTNeI60blkqKP2dUovoRwO1uokN2XWzyBToRjg==","signatures":[{"sig":"MEUCIB5omjHWWeKVoZE8sstzlh+aHbmrx24FUEWg68nVQEaKAiEAxHNZzWPJcU2C1El1ME889A9q2PE2D2WrBw0TPNM0CF8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9773},"main":"./build/index.cjs","type":"module","module":"./build/index.mjs","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.mjs","require":"./build/index.cjs"}},"gitHead":"6ee4b96f5f24f39e723d51bf25b13c69b250132d","scripts":{"test":"mocha test","build":"tsc --emitDeclarationOnly && node build.mjs","prepublishOnly":"npm run build"},"typings":"./build/index.d.ts","_npmUser":{"name":"endel","email":"endel.dreyer@gmail.com"},"repository":{"url":"git://github.com/colyseus/clock.git","type":"git"},"_npmVersion":"10.9.3","description":"A simple clock/ticker implementation to track elapsed/delta time.","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^2.3.3","assert":"^1.3.0","esbuild":"^0.23.0","fast-glob":"^3.3.2","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/clock_2.0.1_1767980657809_0.13014601932681602","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@colyseus/clock","version":"2.0.2","keywords":["clock","ticker","delta","time"],"author":{"name":"Endel Dreyer","email":"endel.dreyer@gmail.com"},"license":"MIT","_id":"@colyseus/clock@2.0.2","maintainers":[{"name":"endel","email":"endel.dreyer@gmail.com"}],"homepage":"https://github.com/colyseus/clock#readme","bugs":{"url":"https://github.com/colyseus/clock/issues"},"dist":{"shasum":"652fb83f3da1f3faa8de7cedd99befcce1bafc92","tarball":"https://registry.npmjs.org/@colyseus/clock/-/clock-2.0.2.tgz","fileCount":8,"integrity":"sha512-a4xNL6DX/n849zkt8o2lZop5UI/NXHltr4RcOJ0Hrf9xbdLM1Auz7uTN1S1GhlL6LTnGXbResLlMeV+KZB7Dhw==","signatures":[{"sig":"MEUCIE6YbmXRLue6bEpED8n7gbj5bae/xs/97ET2Guv5SuAfAiEAx4xd+aXkJKJlbPyENOY5ohIzhi8gwK1Ne5+xv/avV1w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9773},"main":"./build/index.cjs","type":"module","module":"./build/index.mjs","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.mjs","require":"./build/index.cjs"}},"gitHead":"17ac44b7a99e6480a1b6a5fe9667e188bde45c15","scripts":{"test":"mocha test","build":"tsc --emitDeclarationOnly && node build.mjs","prepublishOnly":"npm run build"},"typings":"./build/index.d.ts","_npmUser":{"name":"endel","email":"endel.dreyer@gmail.com"},"repository":{"url":"git://github.com/colyseus/clock.git","type":"git"},"_npmVersion":"10.9.3","description":"A simple clock/ticker implementation to track elapsed/delta time.","directories":{},"_nodeVersion":"22.19.0","_hasShrinkwrap":false,"devDependencies":{"mocha":"^2.3.3","assert":"^1.3.0","esbuild":"^0.23.0","fast-glob":"^3.3.2","typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/clock_2.0.2_1767980814642_0.12181890343555879","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@colyseus/clock","version":"2.0.3","type":"module","description":"A simple clock/ticker implementation to track elapsed/delta time.","author":{"name":"Endel Dreyer","email":"endel.dreyer@gmail.com"},"keywords":["clock","ticker","delta","time"],"repository":{"type":"git","url":"git://github.com/colyseus/clock.git"},"main":"./build/index.cjs","module":"./build/index.mjs","typings":"./build/index.d.ts","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.mjs","require":"./build/index.cjs"}},"scripts":{"test":"mocha test","build":"tsc --emitDeclarationOnly && node build.mjs","prepublishOnly":"npm run build"},"license":"MIT","devDependencies":{"assert":"^1.3.0","esbuild":"^0.23.0","fast-glob":"^3.3.2","mocha":"^2.3.3","typescript":"^5.3.3"},"_id":"@colyseus/clock@2.0.3","gitHead":"17ac44b7a99e6480a1b6a5fe9667e188bde45c15","bugs":{"url":"https://github.com/colyseus/clock/issues"},"homepage":"https://github.com/colyseus/clock#readme","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-kziqG0dcGsvSfcerHLZTY1V2PmGnZAdG5DM0T5BKQDAiYBXYoMqfzA1Wxfe3KSnyeZuP99isffkUQLEwpFYF7A==","shasum":"c07ccc8f82b3cd80f72a6dace518706516052aa3","tarball":"https://registry.npmjs.org/@colyseus/clock/-/clock-2.0.3.tgz","fileCount":8,"unpackedSize":9804,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDorkqHwYx1yD4yNH89cVMf5//lul93Ds6G+VfL0Zu9OAIhAPnzNDLOjL94VrxeGlWCNpA5F7Os+dBrJ375PthJbaDJ"}]},"_npmUser":{"name":"endel","email":"endel.dreyer@gmail.com"},"directories":{},"maintainers":[{"name":"endel","email":"endel.dreyer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clock_2.0.3_1767981011583_0.9098366743328312"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-18T14:30:07.080Z","modified":"2026-01-09T17:50:11.985Z","1.0.0":"2024-07-18T14:30:07.412Z","1.0.1":"2025-10-17T20:34:28.754Z","2.0.0":"2026-01-08T20:40:15.090Z","2.0.1":"2026-01-09T17:44:17.954Z","2.0.2":"2026-01-09T17:46:54.809Z","2.0.3":"2026-01-09T17:50:11.738Z"},"bugs":{"url":"https://github.com/colyseus/clock/issues"},"author":{"name":"Endel Dreyer","email":"endel.dreyer@gmail.com"},"license":"MIT","homepage":"https://github.com/colyseus/clock#readme","keywords":["clock","ticker","delta","time"],"repository":{"type":"git","url":"git://github.com/colyseus/clock.git"},"description":"A simple clock/ticker implementation to track elapsed/delta time.","maintainers":[{"name":"endel","email":"endel.dreyer@gmail.com"}],"readme":"# @colyseus/clock\n\nA simple clock/ticker implementation to track delta/elapsed time.\n\nAPI\n---\n\n- `new Clock([useInterval=false])`\n- `clock.start([useInterval=false])`\n- `clock.stop()`\n- `clock.tick()`\n- `clock.elapsedTime`\n- `clock.deltaTime`\n- `clock.currentTime`\n\nUsage example\n---\n\nThere's two ways you can use clock.js: manual or automatic.\n\n**Automatic**\n\nBy initializing `Clock` with `true` as the first argument, a interval will be\ncreated, in which `tick()` is called 60 times per second.\n\n```typescript\nimport { Clock } from '@colyseus/clock';\nconst clock = new Clock(true);\n```\n\nYou can also call `start(true)` to create the interval.\n\n```javascript\nimport { Clock } from '@colyseus/clock';\nconst clock = new Clock();\nclock.start(true);\n```\n\n**Manual usage**\n\nYou call `tick()` manually in your existing loop.\n\n```typescript\nimport Clock from '@colyseus/clock';\nconst clock = new Clock();\n\nsetInterval(function() {\n  clock.tick();\n  console.log(\"Delta time: \", clock.deltaTime);\n  console.log(\"Elapsed time: \", clock.elapsedTime);\n  console.log(\"Current time: \", clock.currentTime);\n}, 1000 / 60);\n```\n\n\nLicense\n---\n\nMIT\n","readmeFilename":"README.md"}