Announcement

Collapse
No announcement yet.

Time of tick

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Time of tick

    Hi,

    I use:

    var t = rawtime(0,inv("1s"))*1000;
    var d = new Date( tTick );

    And then use

    debugPrintln( d );

    to print out a readable time format for a tick.

    Since rawtime() only accepts "1s" as the smallest time interval, that means I can only find out the time of tick up the the precision of seconds.

    Am I correct or is there any method to determine the time of tick up to milliseconds?

    Thanks a lot.

  • #2
    So it is impossible to have time reading of tick to the precision of shorter than 1 second?

    Comment


    • #3
      If you want higher precision to measure the speed of your code, then I guess you'll have to write a DLL which calls the system clock for a timestamp and then you can easily have precision down to the millisecond level. In this way, you could measure (roughly) how long your individual scripts are taking to run.

      I wouldn't get too excited though...Javascript has been and will always be slower than if eSignal had chosen to adopt .Net integration in v11.x However, the Javascript in v11.x is going to be faster than the previous versions simply because they're using Mozilla's newer "TraceMonkey" Javascript engine.

      As an aside, I have no idea if v11.x is taking advantage of the abilities nowadays of accelerated graphics cards, even if it is only 2-D graphics.

      Comment


      • #4
        I use a this for a msec timer:
        PHP Code:
        function gMS() {        // used for a timer - to count #msec
            
        var xTime=new Date();
            var 
        ms xTime.getTime();
            return (
        ms); 
        Then just call the function from main() or another UDF with something like this:

        nMS1 = gMS() // to start
        ...
        do some stuff
        ...
        nMS2 =gMS() // to finish
        nMSec = nMS2 - nMS1

        Comment


        • #5
          Are there differences in programming functions, commands, operators, etc. between the prior javascript engine and the "TraceMonkey" engine?

          Ref SteveH post below:
          However, the Javascript in v11.x is going to be faster than the previous versions simply because they're using Mozilla's newer "TraceMonkey" Javascript engine.
          Wayne

          Comment


          • #6
            wayne,

            The version of Javascript used in the latest 11.1 release is:

            1.8.0 pre-release 1 2007-10-03

            The version of Javascript used in 10.6 is:

            1.5 pre-release 6a 2004-06-09

            You can go over to the mozilla.org website and search around for all the differences between those two releases. You'll find that, other than bug/efficiency fixes and the just-in-time compile "TraceMonkey" part at the lowest level, backwards compatibility is maintained so it's more a matter of additions to the Javascript language proper.

            Again, it would have been *nice* of eSignal to tell us in the release notes that they introduced a newer release of Javascript and then give the link to mozilla.org for anyone interested in reading up on any new language features introduced. It would have cost them absolutely nothing in terms of support since it is not their responsibility to teach anyone basic Javascript programming beyond what it takes to describe their EFS level of functionality.

            [pj909: thanks for mentioning the Date() function which does have millisecond time resolution...I wasn't thinking on that one.]
            Last edited by SteveH; 03-27-2011, 02:57 PM.

            Comment


            • #7
              Originally posted by pj909
              I use a this for a msec timer:
              PHP Code:
              function gMS() {        // used for a timer - to count #msec
                  
              var xTime=new Date();
                  var 
              ms xTime.getTime();
                  return (
              ms); 
              Then just call the function from main() or another UDF with something like this:

              nMS1 = gMS() // to start
              ...
              do some stuff
              ...
              nMS2 =gMS() // to finish
              nMSec = nMS2 - nMS1
              This method is useful. But it may not be useful if I used it ato replay a tick file.

              However, it is absolutely useful for playing the real-time tick, and I can measure the running time of main().

              Also, I want to know if the efs Performance Monitor reading is realistic or close to real measurement. I have an efs which is more than 1000 lines and the average main() time is just slightly less than 1ms.

              If the reading is real, I would say eSignal efs engine is very fast.

              Comment

              Working...
              X