UNPKG

@getontime/cli

Version:

Time keeping for live events

2 lines 954 B
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`f14ad0099eab1969fdd065b56af5fdd3cf530de6`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`1bdbff4e-4812-490a-867d-1ade33114252`,e._sentryDebugIdIdentifier=`sentry-dbid-1bdbff4e-4812-490a-867d-1ade33114252`)}catch{}})();import{a as e,n as t}from"./jsx-runtime-BNC90REB.js";import{st as n}from"./useSocket-B9-0Z7zf.js";var r=e(t(),1),i=1500;function a(){let e=n(e=>e.clock),t=(0,r.useRef)({clock:e,time:performance.now()}),[,a]=(0,r.useState)(0);(0,r.useEffect)(()=>{t.current={clock:e,time:performance.now()}},[e]),(0,r.useEffect)(()=>{let e=setInterval(()=>a(e=>e+1),1e3);return()=>clearInterval(e)},[]);let o=performance.now()-t.current.time;return o<i?e:t.current.clock+Math.round(o)}export{a as t}; //# sourceMappingURL=useAutoTickingClock-CjJeDQz8.js.map