How to use the jsprim.hrtimeAdd function in jsprim

To help you get started, we’ve selected a few jsprim examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github postcss / postcss-devtools / src / index.js View on Github external
const updateSummary = (summary, {plugin, rawTime}, {precise}) => {
    const summaryForPlugin = summary[plugin] || {rawTime: [0, 0]};
    const newRawTime = hrtimeAdd(summaryForPlugin.rawTime, rawTime);
    const formatted = pretty(newRawTime, {precise});
    const text = 'Completed in ' + pretty(newRawTime, {precise});
    const time = convert(newRawTime);
    return {
        ...summary,
        [plugin]: {rawTime: newRawTime, formatted, text, time},
    };
};