mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-11 07:23:32 -07:00
16 lines
369 B
JavaScript
16 lines
369 B
JavaScript
/** @param {number} ms */
|
|
export function wait(ms) {
|
|
return new Promise((resolve) => {
|
|
setTimeout(resolve, ms);
|
|
});
|
|
}
|
|
|
|
/** @param {string} name */
|
|
export function readCssDuration(name) {
|
|
const value = getComputedStyle(document.documentElement)
|
|
.getPropertyValue(name)
|
|
.trim();
|
|
|
|
return Number.parseFloat(value) * (value.endsWith("ms") ? 1 : 1000);
|
|
}
|