Is there a way to measure time up to micro seconds using C standard library?

后端 未结 5 729
旧时难觅i
旧时难觅i 2021-01-22 03:33

Is there a platform-independent way to measure time up to micro seconds using C standard library?

5条回答
  •  日久生厌
    2021-01-22 04:04

    The POSIX gettimeofday and clock_gettime functions are the closest thing you'll find to platform-independence. Ideally all platforms would follow POSIX, but one notable infamous one (along with various obscure ones) doesn't.

提交回复
热议问题