How do I get milliseconds since midnight UTC in C?

后端 未结 5 1180
太阳男子
太阳男子 2020-12-18 01:45

The time function in time.h gives milliseconds since the epoch.

5条回答
  •  隐瞒了意图╮
    2020-12-18 02:15

    You use gettimeofday(2) which is defined in POSIX.1 and BSD.

    It returns seconds and microseconds as defined in struct timeval from sys/time.h.

提交回复
热议问题