MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / createClock

Function createClock

packages/core/src/runtime/clock.test.ts:4–11  ·  view source on GitHub ↗
(opts?: ConstructorParameters<typeof TransportClock>[0])

Source from the content-addressed store, hash-verified

2import { TransportClock } from "./clock";
3
4function createClock(opts?: ConstructorParameters<typeof TransportClock>[0]) {
5 let ms = 0;
6 const clock = new TransportClock({ nowMs: () => ms, ...opts });
7 const advance = (deltaMs: number) => {
8 ms += deltaMs;
9 };
10 return { clock, advance, getMs: () => ms };
11}
12
13describe("TransportClock", () => {
14 describe("initial state", () => {

Callers 1

clock.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected