Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CRBasic compiler and instruction timing


Anton Jul 1, 2015 01:07 PM

The CRBasic compiler seems to know exactly how long each instruction in my program will take, or at least has a pretty good idea. Is it possible to get it to provide me this information after compilation to help me with my programming?

I am aware of the Instructiontimes instruction, but for this I need to download and run the program, which I cannot always do, and which also is more cumbersome.


JDavis Jul 2, 2015 02:03 PM

The compiler is away of the time needed for analog measurements. It is not aware of the time processing will take.

After loading the program in a datalogger, there are several fields in the Status table to indicate the actual time taken by processes.

The primary fields to look for are MeasureTime and ProcessTime. You can find the explanation of these and the related fields in the datalogger manual.


Anton Jul 2, 2015 02:56 PM

Those are all useful indicators on a running program, but the question still remains: as the compiler knows the time required for each analog measurement instruction, can it tell me what they are?


jra Jul 2, 2015 03:02 PM

Anton, I think you are talking about the "pre-compiler" on the computer, not the actual datalogger compiler. Is that right? If so, no, at this time there is not a way other than actually running the program in the datalogger to know how long it will take.


Anton Jul 2, 2015 03:10 PM

That's right. Can I put this in as a feature request?

Right now when I'm desperate I reduce the scan time to a point where it's too short, and then the compiler tells me how much more time it needs. I can then note how various program changes reduce or increase this amount. Or at least that is what I did 5 years ago when I was desperate--I was really hoping not to have to do this again.


jra Jul 2, 2015 04:44 PM

Will do. Thanks for your feedback!


Anton Jul 7, 2015 01:26 PM

After working with the available tools a bit more, I must comment that MeasureTime is less useful than one might think because it only refers to the main scan. And the InstructionTimes function appears to measure only processing times, not measurement.

There are many very detailed bits of information about timing in the manuals, but a summary table would be very helpful as well.

Log in or register to post/reply in the forum.