Files
lan-manager/web/node_modules/@probe.gl/log/dist/utils/hi-res-timestamp.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

19 lines
525 B
JavaScript

// probe.gl, MIT license
import { window, process, isBrowser } from '@probe.gl/env';
/** Get best timer available. */
export function getHiResTimestamp() {
let timestamp;
if (isBrowser && 'performance' in window) {
timestamp = window?.performance?.now?.();
}
else if ('hrtime' in process) {
// @ts-ignore
const timeParts = process?.hrtime?.();
timestamp = timeParts[0] * 1000 + timeParts[1] / 1e6;
}
else {
timestamp = Date.now();
}
return timestamp;
}