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.
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.
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?
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.
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.
Will do. Thanks for your feedback!
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.