mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-12 07:24:55 -05:00
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:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user