mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 17:36:14 -04:00
use Date.now() instead of new Date().getTime()
This is documented to be more performant. The substitution was made on frontend code, too (i.e., the one in /static), because Date.now() is supported since IE 9, and we are life supporting only IE 11. Commands: find . -name *.js | xargs sed --in-place "s/new Date().getTime()/Date.now()/g" find . -name *.js | xargs sed --in-place "s/(new Date()).getTime()/Date.now()/g" Not done on jQuery.
This commit is contained in:
parent
90bfbeb38d
commit
b34fc2de2b
13 changed files with 23 additions and 23 deletions
|
@ -49,7 +49,7 @@ describe('Responsiveness of Editor', function() {
|
|||
}).done(function(){
|
||||
|
||||
expect( inner$('div').text().length ).to.be.greaterThan( length ); // has the text changed?
|
||||
var start = new Date().getTime(); // get the start time
|
||||
var start = Date.now(); // get the start time
|
||||
|
||||
// send some new text to the screen (ensure all 3 key events are sent)
|
||||
var el = inner$('div').first();
|
||||
|
@ -65,7 +65,7 @@ describe('Responsiveness of Editor', function() {
|
|||
helper.waitFor(function(){ // Wait for the ability to process
|
||||
return true; // Ghetto but works for now
|
||||
}).done(function(){
|
||||
var end = new Date().getTime(); // get the current time
|
||||
var end = Date.now(); // get the current time
|
||||
var delay = end - start; // get the delay as the current time minus the start time
|
||||
|
||||
console.log('delay:', delay);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue