console api - get time start and end values

Hello.

Firstly, I am not sure if this is the right mailing list to discuss this(if
not, would you know what is the best lit to do so?)

What I want to bring to mind is about the console.time and console.timeEnd
methods.
Despite the window.performance, I was trying to use the time and timeend
methods to pass or fail unit tests.
The idea was to verify something like: try to execute something, and if it
took too long to be executed, fail the test.

The only problem is that console.time and console.timeEnd do not return the
values, just flush them straight to the console!

Is there, already, a solution for that(besides creating Date objects...)?
If not, would this be an interesting suggestion?

Thanks.


-- 
*Felipe N. Moura*
Senior Web Developer

Website:  http://felipenmoura.org
 Twitter:    @felipenmoura <http://twitter.com/felipenmoura>
LinkedIn: http://goo.gl/qGmq

Meet some of my projects:
BrazilJS Conference <http://braziljs.com.br/>  |  BrazilJS
Foundation<http://braziljs.org>
|  Power Polygon <http://github.com/braziljs/power-polygon>  |
TheWebMind<http://thewebmind.org/>  |
PHPDevBar<https://addons.mozilla.org/pt-BR/firefox/addon/php-developer-toolbar/>
---------------------------------
LinuxUser #508332
*Changing  the  world*  is the least I expect from  myself!

Received on Thursday, 14 November 2013 02:05:35 UTC