How to measure time? - VxWorks

This is a discussion on How to measure time? - VxWorks ; Hello from Danilo. I'm working with VxWorks using a real time embedded system (not PC or Sun). I need to measure time between two steps in my code. Now I'm using tickLib.h and tickGet() function, but resolution of 16 ms ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: How to measure time?

  1. How to measure time?

    Hello from Danilo.
    I'm working with VxWorks using a real time embedded system (not PC or
    Sun).
    I need to measure time between two steps in my code.
    Now I'm using tickLib.h and tickGet() function, but resolution of 16
    ms is too much for me.

    There is a way to measure with an higher resolution?

    Thanks a lot by Danilo

  2. Re: How to measure time?

    Danilo wrote:

    >Hello from Danilo.


    Hey!

    >I'm working with VxWorks using a real time embedded system (not PC or
    >Sun).
    >I need to measure time between two steps in my code.
    >Now I'm using tickLib.h and tickGet() function, but resolution of 16
    >ms is too much for me.


    You can change tickLib's resolution by changing the system clock rate
    using sysClkRateSet(). The 60 Hz/16 msec rate is only the default.

    >There is a way to measure with an higher resolution?


    You could use the facilities provided by timexLib.

    >Thanks a lot by Danilo


    You're welcome.

    --
    ================================================== ======================
    Michael Kesti | "And like, one and one don't make
    | two, one and one make one."
    mrkesti at hotmail dot com | - The Who, Bargain

  3. Re: How to measure time?


    If you are using a PPC, reading the Time Base Register is the preferred
    way. There are vxWorks calls or you can load the upper and lower
    16bits into variables using asm() calls. The TBS res is whatever your
    CPU clock runs at.

    LC
    On Jan 24, 9:09 am, "Michael R. Kesti" wrote:
    > Danilo wrote:
    > >Hello from Danilo.Hey!

    >
    > >I'm working with VxWorks using a real time embedded system (not PC or
    > >Sun).
    > >I need to measure time between two steps in my code.
    > >Now I'm using tickLib.h and tickGet() function, but resolution of 16
    > >ms is too much for me.You can change tickLib's resolution by changing the system clock rate

    > using sysClkRateSet(). The 60 Hz/16 msec rate is only the default.
    >
    > >There is a way to measure with an higher resolution?You could use the facilities provided by timexLib.

    >
    > >Thanks a lot by DaniloYou're welcome.

    >
    > --
    > ================================================== ======================
    > Michael Kesti | "And like, one and one don't make
    > | two, one and one make one."
    > mrkesti at hotmail dot com | - The Who, Bargain



  4. Re: How to measure time?


    You can use Posix Timer Library.

    On Jan 24, 7:09 pm, "Michael R. Kesti" wrote:
    > Danilo wrote:
    > >Hello from Danilo.Hey!

    >
    > >I'm working with VxWorks using a real time embedded system (not PC or
    > >Sun).
    > >I need to measure time between two steps in my code.
    > >Now I'm using tickLib.h and tickGet() function, but resolution of 16
    > >ms is too much for me.You can change tickLib's resolution by changing the system clock rate

    > using sysClkRateSet(). The 60 Hz/16 msec rate is only the default.
    >
    > >There is a way to measure with an higher resolution?You could use the facilities provided by timexLib.

    >
    > >Thanks a lot by DaniloYou're welcome.

    >
    > --
    > ================================================== ======================
    > Michael Kesti | "And like, one and one don't make
    > | two, one and one make one."
    > mrkesti at hotmail dot com | - The Who, Bargain



  5. Re: How to measure time?

    If you do not want change the sysClkRateSet then try to run the code
    multiple times and then divide the total tick/ num of itertations

    On Jan 24, 7:09 am, "Michael R. Kesti" wrote:
    > Danilo wrote:
    > >Hello from Danilo.Hey!

    >
    > >I'm working with VxWorks using a real time embedded system (not PC or
    > >Sun).
    > >I need to measure time between two steps in my code.
    > >Now I'm using tickLib.h and tickGet() function, but resolution of 16
    > >ms is too much for me.You can change tickLib's resolution by changing the system clock rate

    > using sysClkRateSet(). The 60 Hz/16 msec rate is only the default.
    >
    > >There is a way to measure with an higher resolution?You could use the facilities provided by timexLib.

    >
    > >Thanks a lot by DaniloYou're welcome.

    >
    > --
    > ================================================== ======================
    > Michael Kesti | "And like, one and one don't make
    > | two, one and one make one."
    > mrkesti at hotmail dot com | - The Who, Bargain



  6. Re: How to measure time?

    On Jan 24, 4:57 am, Danilo wrote:
    > Hello from Danilo.
    > I'm working with VxWorks using a real time embedded system (not PC or
    > Sun).
    > I need to measure time between two steps in my code.
    > Now I'm using tickLib.h and tickGet() function, but resolution of 16
    > ms is too much for me.
    >
    > There is a way to measure with an higher resolution?
    >
    > Thanks a lot by Danilo


    I needed to do the same thing and ended up using sysTimestamp() which
    worked well. This is discussed in the FAQ at http://www.xs4all.nl/
    ~borkhuis/vxworks/vxw_pt5.html#5.10

    I also posted an example at http://iwiwdsmi.blogspot.com/2006/12/how-
    to-measure-execution-time-for.html

    So Feng


+ Reply to Thread