Closed mururu closed 9 years ago
It sounds reasonable, and gettimeofday of modern OS (RHEL6+) is fast enough. (it should use clock_gettime if exist) gmtime(3) or localtime(3) are also slow but you can cache the value if the given time_t is equal or near enough.
If you create a patch, I'll merge it. If you show a benchmark which says gmtime/localtime cost is low, such trick is not required.
Thanks. I'll try create a patch tomorrow.
Time.strptime
uses the current system time as base time, butStrptime#exec
dosen't.I need an API which uses the current system time as base time. Is it possible? Or does it cause a serious performance degradation?