Sujet : Re: OT: Programming Languages
De : jl (at) *nospam* glen--canyon.com (john larkin)
Groupes : sci.electronics.designDate : 02. Nov 2024, 00:54:44
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <14qaij9n9tjnr6gc1lfu4o69hb68gtcguf@4ax.com>
References : 1 2 3 4
User-Agent : ForteAgent/8.00.32.1272
On Fri, 1 Nov 2024 16:03:00 -0700, Don Y <
blockedofcourse@foo.invalid>
wrote:
On 11/1/2024 3:50 PM, Nick Hayward wrote:
What about C++?
>
C++ is an order of magnitude more complex than C. Even a
casual C programmer can imagine what his code will look
like after compilation. I.e., can imagine exactly what the
CPU will be doing (ignoring the fact that the compiler will
often out-think the coder in terms of time/space efficiency).
We want to time the execution of a control algorithm. One way to time
it is to run it in a loop maybe 100K times and measure that with a
stopwatch. But a very smart compiler might run it once, notice that
nothing has changed, and skip the reruns.
It's best to bang a port pin and measure it with an oscilloscope.
We've had FPGA compilers do that sort of thing, optimize out
intentional delays. One fix is to XOR signals with a level from a pin
that *we* know is always low.