Commit 839fb0db authored by S Anand's avatar S Anand

REF: use Date.now() instead of new Date() for performance reasons

parent d7dd4114
......@@ -54,7 +54,7 @@ $.fn.doodle = function(options) {
index = 0
path = paths[index]
end_pos = path[WIDTH]
start_time = +new Date()
start_time = Date.now()
tick()
})
.each(function() {
......@@ -85,7 +85,7 @@ $.fn.doodle = function(options) {
duration = (options.duration || default_duration || 2) * 1000
function tick() {
pos = start_pos + easing((+new Date() - start_time) / duration)
pos = start_pos + easing((Date.now() - start_time) / duration)
// Find the current path that is being animated
if (index >= length || pos > paths[index][END_POS]) {
while ((index < length) && (pos > paths[index][END_POS])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment