console.time() on iOS Safari

console, ios, javascript, safari, time

Solution

var start = new Date().getTime();

// ....

var end = new Date().getTime();

console.log(end-start);

Problem

I am trying to optimize a web app for iPad (iOS 5.1.1) and I was wondering how to measure the time spent on a function. On the desktop there is console.time() and console.timeEnd() for both firebug and webkit's console. Unfortunately I cannot make it work on iOS, only console.log() seems to be supported. Any alternatives?

Original source