cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ Creator & Designer

DaSi_281136
New Contributor II

Hello,

Is there a way to to determine the run time of a function?
Normally I'll toggle a pin at the beginning and end of a function and measure with a scope.

That's obviously not a perfect solution as it includes the time to toggle the pin.

I figured there was a way to do this via Creator or during a debug run.

Thanks

0 Likes
1 Solution
odissey1
Honored Contributor II

DaSi,

You didn't mention processor type.

On PSoC4 and PSoC5  you can use a custom component StopWatch to measure elapsed CPU clocks

Re: How to get timestamp in microseconds using Psoc5lp

And for PSoC6

Measuring cycles using DTW on PSoC 6(M4)

/odissey1

View solution in original post

0 Likes
3 Replies
odissey1
Honored Contributor II

DaSi,

You didn't mention processor type.

On PSoC4 and PSoC5  you can use a custom component StopWatch to measure elapsed CPU clocks

Re: How to get timestamp in microseconds using Psoc5lp

And for PSoC6

Measuring cycles using DTW on PSoC 6(M4)

/odissey1

View solution in original post

0 Likes
DaSi_281136
New Contributor II

Thanks for the reply.

I'm using a PSOC5LP.

I'll take a look at using the stopwatch.

I'm hoping to the be able to get nanosecond resolution.

0 Likes
odissey1
Honored Contributor II

The StopWatch accuracy is 1 BUS_CLK, which at 80MHz translates into 12.5ns.

/odissey1

0 Likes