Results 1 to 6 of 6

Thread: Debugging Time Issues

  1. #1
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    597

    Default Debugging Time Issues

    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
    Code:
    Ext.ux.Time.start('demo')
    and get the result with
    Code:
    Ext.ux.Time.stop('demo')
    Further you can add this to keep the control on a long term with adding start and getTime like:
    Code:
    var curTime = Ext.ux.Time.getTime('demo')
    I have uploaded it to the Sencha Market.

    Sencha Market Link

    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

  2. #2
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    811

    Default

    what are the advantages of using your extension ?
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    597

    Default

    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.

  4. #4

    Default

    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

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    597

    Default

    Why not use the simple version:
    Found it here

    Code:
    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));
    
    • Kurt001

    Code Review | Send PM


    Need to include a test case use:
    https://fiddle.sencha.com/#home

  6. #6

    Default

    Quote Originally Posted by Kurt001 View Post
    Why not use the simple version:
    Found it here

    Code:
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •