Replaced 'new Date().getTime()' calls with 'Date.now()' for clarity and performance
This commit is contained in:
1 parent
9d09146f68
commit
75da5b650c
5 files changed
+12
-12
No files matched your search
Vendored
+2
-2
@@ -70,7 +70,7 @@ if (typeof document !== 'undefined') {
|
||||
try {
|
||||
// Mouse move event to fill random array
|
||||
document.addEventListener('mousemove', function (e) {
|
||||
randomRing.set((new Date().getTime() & 255) ^
|
||||
randomRing.set((Date.now() & 255) ^
|
||||
((e.clientX || e.pageX) & 255) ^
|
||||
((e.clientY || e.pageY) & 255));
|
||||
}, false);
|
||||
@@ -80,7 +80,7 @@ if (typeof document !== 'undefined') {
|
||||
try {
|
||||
// Keypress event to fill random array
|
||||
document.addEventListener('keydown', function (e) {
|
||||
randomRing.set((new Date().getTime() & 255) ^
|
||||
randomRing.set((Date.now() & 255) ^
|
||||
(e.keyCode & 255));
|
||||
}, false);
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user