All Projects → influxdata → cron

influxdata / cron

Licence: MIT license
A fast, zero-allocation cron parser in ragel and golang

Programming Languages

go
31211 projects - #10 most used programming language
Ragel
52 projects

cron

A fast non-allocating cron parser in ragel and golang.

features

  • standard five-position cron
  • six-position cron with seconds
  • seven-position cron with seconds and years
  • case-insensitive days of the week
  • case-insensitive month names
  • Quartz compatible ranges e.g.: 4/10, SUN-THURS/2
  • timezone handling (other than UTC)
  • Quartz compatible # handling, i.e. 5#3 meaning the third friday of the month
  • Quartz compatible L handling, i.e. 5L in the day of week field meaning the last friday of a month, or 3L in the day of month field meaning third to last day of the month

performance

On a 3.1 Ghz Core i7 MacBook Pro (Retina, 15-inch, Mid 2017):

BenchmarkParse/0_*_*_*_*_*_*-8 20000000 63.5 ns/op 0 B/op
BenchmarkParse/1-6/2_*_*_*_Feb-Oct/3_*_*-8 10000000 118 ns/op 0 B/op
BenchmarkParse/1-6/2_*_*_*_Feb-Oct/3_*_2020/4-8 1000000 146 ns/op 0 B/op

TODO

  • Once we are done adding all of the Quartz cron features, to copy and pass all of Quartz's parsing tests.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].