Time or timer in C?
Tristan M. (2946) 1036 posts |
I have some code whicn needs to be able to set some short delays, and to be able to check elapsed time to know when to timeout if there is an issue. Even the equivalent of TIME in BASIC would be sufficient. |
Dave Higton (1515) 3404 posts |
What about the monotonic timer? |
André Timmermans (100) 620 posts |
clock_t clock() from include |
Tristan M. (2946) 1036 posts |
Andre, in DDE clock() just seems to be returning zero. Is there something else that needs to be done. Dave thanks. I’ll hit the PRMs to find it. It’s impossible to find something if I don’t know what I’m looking for. |
Jon Abbott (1421) 2598 posts |
|
Tristan M. (2946) 1036 posts |
Works great. Thanks. |
Tim Rowledge (1742) 170 posts |
I strongly recommend Rik Griffin ‘s HALTimer module for handling delays. |
Tristan M. (2946) 1036 posts |
I was originally using HAL timer SWIs directly for something else. I’m guessing the module adds some abstraction to them? |