Calculating elapsed time in a C program in milliseconds

后端 未结 5 1227
你的背包
你的背包 2020-11-29 03:36

I want to calculate the time in milliseconds taken by the execution of some part of my program. I\'ve been looking online, but there\'s not much info on this topic. Any of y

5条回答
  •  無奈伤痛
    2020-11-29 04:21

    Another option ( at least on some UNIX ) is clock_gettime and related functions. These allow access to various realtime clocks and you can select one of the higher resolution ones and throw away the resolution you don't need.

提交回复
热议问题