Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Arvin iuunhao
Added: Jun 18, 2018 8:41 AM
Views: 9
Tags: js
计算函数执行所花费的时间
  1. const timeTaken = callback => {
  2.   console.time('timeTaken');
  3.   const r = callback();
  4.   console.timeEnd('timeTaken');
  5.   return r;
  6. };