PDA

View Full Version : time for PBP statements



fnovau
- 22nd October 2006, 20:42
Should it be possible to know how much time or clock cycles needs PicBasic Pro compiler to execute every of its statements? I'm specially interested in If..Then..else, High, Low, While ..Wen and For..Next and GoTo
-Francesc

sayzer
- 22nd October 2006, 20:49
Hi Francesc,

Here is your answer.

Check this post.

http://www.picbasic.co.uk/forum/showthread.php?t=2367&highlight=timer1



-----------------------

fnovau
- 24th October 2006, 14:37
Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
-Francesc

SteveB
- 24th October 2006, 15:55
Francesc,

You might try this include file I was working on and haven't gotten a chance to post. It should be self explianatory (assuming you are carefully reading your PICs datasheet and the PBP manual.

CodeTimer (http://home.earthlink.net/~2hosting/Files/CodeTimer_012_3d.bas)

HTH,
Steve B

sayzer
- 24th October 2006, 16:15
Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
-Francesc


Ok, I see.

But, my curiosity, why would you need to know that information?
A kind of HW or what?


----------------------------------------------------

mister_e
- 25th October 2006, 15:32
Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
-Francesc
Impossible to know uneless you measure every single statement or a block of.

How many different IF-THEN-ELSE combination exist?
How many different HSERIN combination exist?
How many different LCDOUT combination exist?
....
nobody can answer that. So you need to measure everything. Using a internal Timer or an i/o and a scope.

Now if you add some interupts in the chain... it's quite impossible to know uneless you sim every conditions... good luck!

Darrel Taylor
- 25th October 2006, 19:42
Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
-Francesc

You should take a look at the program SteveB showed in Post# 4.

It's a great little program that can tie in with "ON DEBUG", and will show the exact time of each individual line of code in your program. It's pretty cool.
<br>