@20i/timesync 中文文档教程
@20i/timesync
该库提供了一种与时间服务器同步时间的方法(默认为 20i 时间服务器)
import timesync from "@20i/timesync"
async function() {
await timesync.sync({ delay: 50 })
console.log("offsetMs", timesync.offsetMs)
console.log("moment", timesync.now().toISOString())
}
@20i/timesync
This library provides a way to get synchronized Time with a time server (20i time server by default)
import timesync from "@20i/timesync"
async function() {
await timesync.sync({ delay: 50 })
console.log("offsetMs", timesync.offsetMs)
console.log("moment", timesync.now().toISOString())
}
更多