* src/timefns.c (decode_time_components): If FASTER_TIMEFNS, when
returning the current time and the desired form is struct timespec
or time_t, return it directly rather than converting it to struct
ticks_hz and then to struct timespec. This can avoid some mpz
calculations and/or bignums.
(cherry picked from commit
e8b3c4cb58ce6e78b9bcfb9146f0ac6ece0d3055)
eassume (false);
case TIMEFORM_NIL:
- ticks = timespec_ticks (current_timespec ());
- hz = timespec_hz;
+ {
+ struct timespec now = current_timespec ();
+ if (FASTER_TIMEFNS
+ && (cform == CFORM_TIMESPEC || cform == CFORM_SECS_ONLY))
+ return (struct err_time) { .time = { .ts = now } };
+ ticks = timespec_ticks (now);
+ hz = timespec_hz;
+ }
break;
default: