You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
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,
|
|
};
|