Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F4503327
test_concurrent_timing.cjs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
822 B
Referenced Files
None
Subscribers
None
test_concurrent_timing.cjs
View Options
console.log("START");
const start = Date.now();
async function delay(ms, name) {
console.log(`${name}: Starting ${ms}ms wait at +${Date.now() - start}ms`);
await new Promise(resolve => setTimeout(() => {
console.log(`${name}: Timer fired at +${Date.now() - start}ms`);
resolve();
}, ms));
console.log(`${name}: Resumed at +${Date.now() - start}ms`);
return `${name}_done`;
}
console.log("Calling func1 at +${Date.now() - start}ms");
delay(100, "func1").then(r => console.log(`func1 complete: ${r} at +${Date.now() - start}ms`));
console.log("Called func1, calling func2 at +${Date.now() - start}ms");
delay(50, "func2").then(r => console.log(`func2 complete: ${r} at +${Date.now() - start}ms`));
console.log("Called func2 at +${Date.now() - start}ms");
console.log("END at +${Date.now() - start}ms");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 3, 9:25 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
521204
Default Alt Text
test_concurrent_timing.cjs (822 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment