const during = (func, name = 'func') => { let time = Date.now(), error = null; try { func(); } catch (e) { error = e; } const msg = `[debug] exec ${name} during ${Date.now() - time}ms`; if (error) { msg += ' with error'; } console.info(msg, error); }; export default { during, };