ktongue's picture
download
raw
633 Bytes
import {timeInterval} from "./interval.js";
export const millisecond = timeInterval(() => {
// noop
}, (date, step) => {
date.setTime(+date + step);
}, (start, end) => {
return end - start;
});
// An optimized implementation for this simple case.
millisecond.every = (k) => {
k = Math.floor(k);
if (!isFinite(k) || !(k > 0)) return null;
if (!(k > 1)) return millisecond;
return timeInterval((date) => {
date.setTime(Math.floor(date / k) * k);
}, (date, step) => {
date.setTime(+date + step * k);
}, (start, end) => {
return (end - start) / k;
});
};
export const milliseconds = millisecond.range;

Xet Storage Details

Size:
633 Bytes
·
Xet hash:
aa3d5e3153da35d7f8e8531c2d4bcfbfd9a9da2bdbd8eab0ecf68cac974b0a64

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.