mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
* reduce watcher timeout in windows, fix hot reload with empty files * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
9 lines
431 B
TypeScript
9 lines
431 B
TypeScript
// const content = await Bun.file(import.meta.path).text();
|
|
const content = require("fs").readFileSync(import.meta.path, "utf8");
|
|
const timebegin = content.indexOf("\n// time:");
|
|
const prev = parseFloat(content.substring(timebegin + 9));
|
|
const current = performance.now() + performance.timeOrigin;
|
|
console.log(current - prev);
|
|
require("fs").writeFileSync(import.meta.path, content.substring(0, timebegin + 9) + current);
|
|
// time:0
|