Topic
1 reply Latest Post - ‏2010-07-06T14:23:48Z by PedroGonnet
PedroGonnet
PedroGonnet
12 Posts
ACCEPTED ANSWER

Pinned topic Timing programs on the SystemSim

‏2010-07-06T14:01:07Z |
Hi again,

I've been porting an application to the Cell/BE using the SystemSim and I wanted to get an idea of its performance.

The original applications uses the clock() system call to get timing data, but this doesn't seem to work on the SystemSim.

What is the indicated/best way of getting timings on the SystemSim? I'm just looking for a stopwatch-type function from which I can extract either system or wall-clock times or even the number of cycles...

Cheers, Pedro.
Updated on 2010-07-06T14:23:48Z at 2010-07-06T14:23:48Z by PedroGonnet
  • PedroGonnet
    PedroGonnet
    12 Posts
    ACCEPTED ANSWER

    Re: Timing programs on the SystemSim

    ‏2010-07-06T14:23:48Z  in response to PedroGonnet
    Sorry, just solved this myself... Should google better next time.

    I've #included <ppu_intrinsics.h> and use __mftb() to get an unsigned long long. If I divide the difference between the return values of two calls by the timebase delivered by "cat /proc/cpuinfo", I get the number of elapsed seconds.

    Cheers and sorry for posting unnecessarily,
    Pedro