mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
chore: Replace Date.now with console.time
Co-authored-by: Alois Klink <alois@aloisklink.com>
This commit is contained in:
parent
170bbce0d3
commit
77a181978e
@ -20,9 +20,9 @@ const zenumlCtx = await context(
|
|||||||
const contexts = [mermaidCtx, mermaidIIFECtx, externalCtx, zenumlCtx];
|
const contexts = [mermaidCtx, mermaidIIFECtx, externalCtx, zenumlCtx];
|
||||||
|
|
||||||
const rebuildAll = async () => {
|
const rebuildAll = async () => {
|
||||||
const time = Date.now();
|
console.time('Rebuild time');
|
||||||
await Promise.all(contexts.map((ctx) => ctx.rebuild()));
|
await Promise.all(contexts.map((ctx) => ctx.rebuild()));
|
||||||
console.log('Rebuilt in' + (Date.now() - time) + 'ms');
|
console.timeEnd('Rebuild time');
|
||||||
};
|
};
|
||||||
|
|
||||||
let clients: { id: number; response: Response }[] = [];
|
let clients: { id: number; response: Response }[] = [];
|
||||||
@ -64,7 +64,7 @@ function sendEventsToAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createServer() {
|
async function createServer() {
|
||||||
await rebuildAll();
|
handleFileChange();
|
||||||
const app = express();
|
const app = express();
|
||||||
chokidar
|
chokidar
|
||||||
.watch('**/src/**/*.{js,ts,yaml,json}', {
|
.watch('**/src/**/*.{js,ts,yaml,json}', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user