Timers are generally provided by GUI frameworks since most GUI framework requires that all drawing commands and GUI modifications be issued only on the main thread. Other similar frameworks that have similar requirements (i.e. certain tasks to be done only under certain conditions) would also provide timer implementation that are compatible with the restrictions imposed by the framework. Use the timer provided by the framework you need to be compatible with whenever possible.
Otherwise if you want to implement it yourself, there are at least two common ways to implement timers, one is to use threads that sleeps until the next event, the other, more common in GUI framework, is to use event loop. Another common way, for very long running tasks in where interval precision is not really important, is to use cron (Unix and Unix-like systems) or Scheduled Tasks (Windows) or Alarm Intents (Android).
What would be the proper way of doing it?
Ignore what others said about specific way to do it, the proper way to do time depends on what you're trying to do. Whether you want short or long interval, whether you need very precise timing or if you're fine with slightly late and/or early event, whether you need to care about saving battery/CPU, whether you need fixed starting interval or fixed end-to-start interval, whether the task finishes quickly or if it may take some time to finish, whether you want to allow another task to start before the previous one starts, whether you want persistence (i.e. whether you want to be able to continue the timer after system reboot or process kill). All these will affect the best Timer to use.