Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

General • Re: System ticks not lasting the expected time (off by several orders of magnitude)

$
0
0
To be rather frank and honest with you, that is a lot of poor code. The functionality of the timer is all over your program -- a maintenance nightmare. Timing is a simple thing using API calls and your code will take too much effort to maintain.

I browsed it and I don't want to try fixing it because I would be helping to reinforce bad habits. If someone else wants to do so, be my guest.

You should read or browse more high-quality C projects source code. (Don't write code like this if you are coding for a living, heheh.) Reading open-source code by professional coders help.

RVR is a 24 bit timer and mixing it with 64 bit ints plus all sorts of overflow tests etc spells nightmare. Nah... I don't want to fix that.

Use the API calls to do your timings.

Statistics: Posted by katak255 — Tue Aug 20, 2024 12:31 am



Viewing all articles
Browse latest Browse all 4151

Trending Articles