message: MessageValue<Data>
): void {
try {
- let taskPerformance = this.beginTaskPerformance()
+ let taskPerformance = this.beginTaskPerformance(message.name)
const res = fn(message.data)
taskPerformance = this.endTaskPerformance(taskPerformance)
this.sendToMainWorker({
return fn
}
- private beginTaskPerformance (): TaskPerformance {
+ private beginTaskPerformance (name?: string): TaskPerformance {
this.checkStatistics()
return {
+ name: name ?? DEFAULT_FUNCTION_NAME,
timestamp: performance.now(),
...(this.statistics.elu && { elu: performance.eventLoopUtilization() })
}