From: Thomas Marullo on
Is there a way to trace the execution times of blocks and/or lines of code when using xPC? I want to find out how well my model is executing and while the TET metrics are useful, I really want to find out where the bottlenecks are in my code.
From: Gordon Weast on
Thomas,

In xpclib/Misc the Time Stamp Counter block reads the Pentium time stamp
counter. That counter runs at the CPU clock speed. The block runs
after the input data dependency is met, but check the sorted order
to make sure. The Time Stamp Delta block differences two values to
get the time between counter reads. You will need to divide by the
CPU clock frequency to get seconds.

Reading the Pentium counter only adds a very small amount of execution
time to the model.

Gordon Weast
xPC Target Development
The MathWorks


Thomas Marullo wrote:
> Is there a way to trace the execution times of blocks and/or lines of
> code when using xPC? I want to find out how well my model is executing
> and while the TET metrics are useful, I really want to find out where
> the bottlenecks are in my code.
From: Thomas Marullo on
Thanks. Is there something that can be used inside an Embedded Matlab Function also?

Gordon Weast <gweast(a)mathworks.com> wrote in message <i0vivt$k3p$1(a)fred.mathworks.com>...
> Thomas,
>
> In xpclib/Misc the Time Stamp Counter block reads the Pentium time stamp
> counter. That counter runs at the CPU clock speed. The block runs
> after the input data dependency is met, but check the sorted order
> to make sure. The Time Stamp Delta block differences two values to
> get the time between counter reads. You will need to divide by the
> CPU clock frequency to get seconds.
>
> Reading the Pentium counter only adds a very small amount of execution
> time to the model.
>
> Gordon Weast
> xPC Target Development
> The MathWorks
>
>
> Thomas Marullo wrote:
> > Is there a way to trace the execution times of blocks and/or lines of
> > code when using xPC? I want to find out how well my model is executing
> > and while the TET metrics are useful, I really want to find out where
> > the bottlenecks are in my code.
From: Gordon Weast on
Thomas,

Not that I know of.

Gordon Weast
xPC Target Development
The MathWorks

Thomas Marullo wrote:
> Thanks. Is there something that can be used inside an Embedded Matlab
> Function also?
>
> Gordon Weast <gweast(a)mathworks.com> wrote in message
> <i0vivt$k3p$1(a)fred.mathworks.com>...
>> Thomas,
>>
>> In xpclib/Misc the Time Stamp Counter block reads the Pentium time stamp
>> counter. That counter runs at the CPU clock speed. The block runs
>> after the input data dependency is met, but check the sorted order
>> to make sure. The Time Stamp Delta block differences two values to
>> get the time between counter reads. You will need to divide by the
>> CPU clock frequency to get seconds.
>>
>> Reading the Pentium counter only adds a very small amount of execution
>> time to the model.
>>
>> Gordon Weast
>> xPC Target Development
>> The MathWorks
>>
>>
>> Thomas Marullo wrote:
>> > Is there a way to trace the execution times of blocks and/or lines of
>> > code when using xPC? I want to find out how well my model is executing
>> > and while the TET metrics are useful, I really want to find out where
>> > the bottlenecks are in my code.