3 ms·
How to log a timestamp
- viraptor 10y agoI'd go a bit further. Log before the operation. If you want the duration, log it separately, afterwards. This prevents issues where the long operation fails for some reason and never leaves a trace. Yes, you should also log failures, but sometimes that may fail too if the long process manages to crash everything.