小编sbr*_*sbr的帖子

Underscrore现在的方法如何更快?

我很好奇Underscore的_.now方法比单纯的更快new Date().getTime().我在他们的github代码库上看到以下内容.

// A (possibly faster) way to get the current timestamp as an integer.
_.now = Date.now || function() {
    return new Date().getTime();
};
Run Code Online (Sandbox Code Playgroud)

有人可以解释一下这里发生了什么吗?

javascript performance time date underscore.js

5
推荐指数
1
解决办法
98
查看次数

标签 统计

date ×1

javascript ×1

performance ×1

time ×1

underscore.js ×1