mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-30 09:18:01 -05:00
Compare commits
1 Commits
staging
...
cursor/sta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49532627a1 |
@@ -71,7 +71,7 @@ export class BlockExecutor {
|
||||
this.callOnBlockStart(ctx, node, block)
|
||||
}
|
||||
|
||||
const startTime = Date.now()
|
||||
const startTime = performance.now()
|
||||
let resolvedInputs: Record<string, any> = {}
|
||||
|
||||
const nodeMetadata = this.buildNodeMetadata(node)
|
||||
@@ -145,7 +145,7 @@ export class BlockExecutor {
|
||||
})) as NormalizedBlockOutput
|
||||
}
|
||||
|
||||
const duration = Date.now() - startTime
|
||||
const duration = performance.now() - startTime
|
||||
|
||||
if (blockLog) {
|
||||
blockLog.endedAt = new Date().toISOString()
|
||||
@@ -221,7 +221,7 @@ export class BlockExecutor {
|
||||
isSentinel: boolean,
|
||||
phase: 'input_resolution' | 'execution'
|
||||
): NormalizedBlockOutput {
|
||||
const duration = Date.now() - startTime
|
||||
const duration = performance.now() - startTime
|
||||
const errorMessage = normalizeError(error)
|
||||
const hasResolvedInputs =
|
||||
resolvedInputs && typeof resolvedInputs === 'object' && Object.keys(resolvedInputs).length > 0
|
||||
|
||||
@@ -101,7 +101,7 @@ export class ExecutionEngine {
|
||||
}
|
||||
|
||||
async run(triggerBlockId?: string): Promise<ExecutionResult> {
|
||||
const startTime = Date.now()
|
||||
const startTime = performance.now()
|
||||
try {
|
||||
this.initializeQueue(triggerBlockId)
|
||||
|
||||
@@ -125,8 +125,8 @@ export class ExecutionEngine {
|
||||
return this.buildPausedResult(startTime)
|
||||
}
|
||||
|
||||
const endTime = Date.now()
|
||||
this.context.metadata.endTime = new Date(endTime).toISOString()
|
||||
const endTime = performance.now()
|
||||
this.context.metadata.endTime = new Date().toISOString()
|
||||
this.context.metadata.duration = endTime - startTime
|
||||
|
||||
if (this.cancelledFlag) {
|
||||
@@ -146,8 +146,8 @@ export class ExecutionEngine {
|
||||
metadata: this.context.metadata,
|
||||
}
|
||||
} catch (error) {
|
||||
const endTime = Date.now()
|
||||
this.context.metadata.endTime = new Date(endTime).toISOString()
|
||||
const endTime = performance.now()
|
||||
this.context.metadata.endTime = new Date().toISOString()
|
||||
this.context.metadata.duration = endTime - startTime
|
||||
|
||||
if (this.cancelledFlag) {
|
||||
@@ -433,8 +433,8 @@ export class ExecutionEngine {
|
||||
}
|
||||
|
||||
private buildPausedResult(startTime: number): ExecutionResult {
|
||||
const endTime = Date.now()
|
||||
this.context.metadata.endTime = new Date(endTime).toISOString()
|
||||
const endTime = performance.now()
|
||||
this.context.metadata.endTime = new Date().toISOString()
|
||||
this.context.metadata.duration = endTime - startTime
|
||||
this.context.metadata.status = 'paused'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user