Loops/timers in C

前端 未结 7 1591
忘了有多久
忘了有多久 2020-12-09 06:05

How does one create a timer in C?

I want a piece of code to continuously fetch data from a gps parsers output.

Are there good libraries for this or should it

7条回答
  •  半阙折子戏
    2020-12-09 06:32

    If the gps data is coming from some hardware device, like over a serial port, then one thing that you may consider is changing the architecture around so that the parser kicks off the code that you are trying to run when more data is available.

    It could do this through a callback function or it could send an event - the actual implementation would depend on what you have available.

提交回复
热议问题