r/cprogramming • • Oct 29 '26

The Hidden Cost of localtime(): repeated systems calls in glibc

/r/C_Programming/comments/1xfytgr/the_hidden_cost_of_localtime_repeated_systems/
0 Upvotes

3 comments sorted by

2

u/Key_River7180 Oct 30 '26

How often do you call localtime(), thought?

1

u/Yairlenga 26d ago

In my server - localtime was called repeatedly inside a logging function to attach timestamp to the log record - multiple times in every request processing.

1

u/Key_River7180 26d ago

run without verbose logging :)