Difference between gcron and gtimer

Differences between Cron Job and Timer:

  • gtimer is a high-performance module, a core framework module, serving as the foundation for building any scheduled task, with method operation times measured in nanoseconds.
  • gtimer is applicable in any scheduled task scenario, such as TCP communication, game development, etc.
  • gcron supports the classic crontab syntax for scheduled tasks, with a minimum time setting interval of seconds.
  • gcron is implemented based on gtimer.
Similar ModuleDescriptionPerformanceLinux-like Crontab PatternUnderlying Implementation
Cron JobScheduled task.
Higher-level encapsulation, time scale in natural seconds.
GeneralSupportedBased on gtimer
TimerTimer.
Low-level component, time scale in terms of time slots (customizable).
EfficientNot supportedCustom implementation based on PriorityQueue data structure