The purpose of this module is to maintain externally synchronized time and provide
the now()
function that returns that time.
yarn add @exodus/synchronized-time
import { SynchronizedTime } from '@exodus/synchronized-time'
console.log(SynchronizedTime.now())
The module can be used with Date
like this:
const syncedDate = new Date(SynchronizedTime.now())
or instead of Date.now():
const syncedNow = SynchronizedTime.now()