fix timing script

This commit is contained in:
Pooya Parsa 2020-11-03 18:09:39 +01:00
parent ee27e3b5fe
commit ec8468635b

View File

@ -56,7 +56,7 @@ export const getRollupConfig = (config) => {
if (config.logStartup) { if (config.logStartup) {
options.output.intro += 'global._startTime = process.hrtime();' options.output.intro += 'global._startTime = process.hrtime();'
// eslint-disable-next-line no-template-curly-in-string // eslint-disable-next-line no-template-curly-in-string
options.output.outro += 'global._endTime = process.hrtime(global._startTime); global._coldstart = ((_endTime[0] * 1e9) + _endTime[1]) / 1e6; console.log(`λ Cold start took: ${global._coldstart}ms`);' options.output.outro += 'global._endTime = process.hrtime(global._startTime); global._coldstart = ((global._endTime[0] * 1e9) + global._endTime[1]) / 1e6; console.log(`λ Cold start took: ${global._coldstart}ms`);'
} }
// https://github.com/rollup/plugins/tree/master/packages/replace // https://github.com/rollup/plugins/tree/master/packages/replace