怎么获得当前精确时间?

想测一个阻塞函数的性能,需要较精确的时间,比如毫秒级
具体点,想这样:

let start_time = get_time();
do_block();
console.log(‘duration:’, get_time()-start_time);

这个get_time函数不知道该用什么

测试性能,可以用

console.time('do block');
do_block();
console.timeEnd('do block');

爱你 jare 么么哒

我也爱你么么哒

在 一 起!在 一 起!

怎么没这个function?