PDA

View Full Version : Debugging Time Issues



Kurt001
10 May 2013, 12:40 AM
Ext.ux.mgd.logger.Time

Hi,

I have uploaded a debugging component - a timer.
This works much like the console.time('demo') . You start timing with

Ext.ux.Time.start('demo')
and get the result with

Ext.ux.Time.stop('demo')

Further you can add this to keep the control on a long term with adding start and getTime like:

var curTime = Ext.ux.Time.getTime('demo')

I have uploaded it to the Sencha Market.

Sencha Market Link (https://market.sencha.com/extensions/ext-ux-mgd-logger-time)

In my live example you can press the buttons on the stop watch.
I am using Ext.defer(fn,1000) and send a getTime to request the current time.
The live example can be found at:
German

http://www.m-gd.com/sencha-component-time-logger/

English (currently translating)
http://www.m-gd.com/en/sencha-component-time-logger/

I am looking forward to some feedback to possibly improve the component

vadimv
10 May 2013, 3:54 AM
what are the advantages of using your extension ?

Kurt001
10 May 2013, 4:13 AM
E.g.:
Having a lot of devices which run at different speed I set this to a maximum time and if the any device takes longer than the time I set an alarm to notifiy the tester (I am not testing it on all devices, so anyone can give me feedback).
As I am not always having the device output of the console in my logcat I am getting the output to a popup.
Further ie does not support the time command.

Mostly I use it for initialization/startup of an app and for localStorage queries.

Knowing exactly which part of the app takes a lot of time is essential to me.

radekwilczak
13 Aug 2014, 9:37 AM
Is there any way to measure time in Sencha Touch with micro seconds? You timer measure with mili seconds. And console.time() and console.timeEnd() doesn't work :( I don't know why :(

Kurt001
17 Aug 2014, 4:29 AM
Why not use the simple version:
Found it here (http://justgit.com/?q=console.time%20javascript)


var start, end, output, i;

start = new Date().getTime();

// do whatever you need to know how long it takes
for (i = 1; i <= 1e6; i++)
output += i;

end = new Date().getTime();
console.log('Time: ' + (end - start));

radekwilczak
29 Aug 2014, 10:36 AM
Why not use the simple version:
Found it here (http://justgit.com/?q=console.time%20javascript)


var start, end, output, i;

start = new Date().getTime();

// do whatever you need to know how long it takes
for (i = 1; i <= 1e6; i++)
output += i;

end = new Date().getTime();
console.log('Time: ' + (end - start));


Because I need microsecond and you example is in milisecond.