Efficient Timer Algorithm

前端 未结 3 616
無奈伤痛
無奈伤痛 2021-02-04 16:04

What is the best algorithm to implement a simple timer library. The library should allow the following:

  1. Timers to be started
  2. Timers to be stopped
3条回答
  •  名媛妹妹
    2021-02-04 16:30

    On POSIX-ish systems, you can use the timer_create/timer_settime family of functions to provide a lot of this "for free."

提交回复
热议问题