1 Reply Latest reply on Oct 14, 2009 5:08 PM by RedOctober57

    measuring ellapsed time always zero in FlashBuilder 4

    RedOctober57 Level 1

      Here is what I have worked out so far:


      I declare some public variables.


                  import flash.utils.getTimer;
                  import mx.controls.Alert;
                  import mx.events.FlexEvent;
                  import mx.events.ListEvent;
                  public var now: Date = new Date;
                  public var beg_tck: uint;
                  public var end_tck: uint;


      I then start my app in debug mode.


      I then click a button and load the beg_tck variable:


                  protected function btnGo_clickHandler(event:MouseEvent):void

                   beg_tck = now.getTime();
                   ... "hit and stay at debug stop"...



      I go over to the debug screen in FlashBuilder 4 and wait about 3 seconds, then I resume with F8


      I have a updateComplete which loads the end_tck, and displays their contents.



              protected function grdSBJs_updateCompleteHandler(event:FlexEvent):void
                          end_tck = now.getTime();  //  - beg_tck
                          lblResponseTime.text = 'Response time: ' + String((end_tck)) + '  beg_tck: ' + String(beg_tck);                   



      For some reason beg_tck and end_tck are ALWAYS THE SAME.


      Why is this happening?  Even though I've held back processing for 3 seconds, the now.getTime() is putting the exact same number into beg_tck and end_tck.


      Thanks in advance for any help you can provide.