Is it entering and exiting the Kernel? or executing the actual system routine to determine the time, or is it making the function call, or is it storing the system call's returned value?

  • 1
    Definitely "entering and exiting the Kernel" is the expensive bit - in particular, saving and restoring the process context. – Murray Jensen Jan 7 '18 at 4:20
  • 2
    On many architectures, gettimeofday is handled by the vDSO and doesn’t need to switch to kernel mode. – Stephen Kitt Jan 7 '18 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.