Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw Error('Cannot collect time profile, duration is undefined.');
}
const durationMillis = parseDuration(prof.duration);
if (!durationMillis) {
throw Error(
`Cannot collect time profile, duration "${prof.duration}" cannot` +
` be parsed.`
);
}
const options = {
durationMillis,
intervalMicros: this.config.timeIntervalMicros,
sourceMapper: this.sourceMapper,
};
const p = await timeProfiler.profile(options);
prof.profileBytes = await profileBytes(p);
return prof;
}