fix(terminal): start precision (#3078)

* fix(executor): use performance.now() for precise block timing

Replace Date.now() with performance.now() for timing measurements in
the executor to provide sub-millisecond precision. This fixes timing
discrepancies with fast-executing blocks like the start block where
millisecond precision was insufficient.

Changes:
- block-executor.ts: Use performance.now() for block execution timing
- engine.ts: Use performance.now() for overall execution timing

Co-authored-by: emir <emir@simstudio.ai>

* format ms as whole nums,round secs to 2 decimal places and compute all started/ended times on server and passback to clinet

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: waleed <walif6@gmail.com>
This commit is contained in:
Emir Karabeg
2026-01-30 12:52:08 -08:00
committed by GitHub
parent aec0de046b
commit 2c4eb9fecb
12 changed files with 107 additions and 69 deletions

View File

@@ -281,9 +281,12 @@ export class LoopOrchestrator {
// Emit onBlockComplete for the loop container so the UI can track it
if (this.contextExtensions?.onBlockComplete) {
const now = new Date().toISOString()
this.contextExtensions.onBlockComplete(loopId, 'Loop', 'loop', {
output,
executionTime: DEFAULTS.EXECUTION_TIME,
startedAt: now,
endedAt: now,
})
}

View File

@@ -265,9 +265,12 @@ export class ParallelOrchestrator {
// Emit onBlockComplete for the parallel container so the UI can track it
if (this.contextExtensions?.onBlockComplete) {
const now = new Date().toISOString()
this.contextExtensions.onBlockComplete(parallelId, 'Parallel', 'parallel', {
output,
executionTime: 0,
startedAt: now,
endedAt: now,
})
}