[英]How can I get the current time in milliseconds using C?
如何在C中獲得當前時間(以毫秒為單位)? 我正在做以下事情以便在幾秒鍾內獲得時間:
struct tm ptm;
now = time(NULL);
localtime_r(&now,ptm);
myTime= (ptm->tm_hour * 3600) + (ptm->tm_min * 60) + (ptm->tm_sec);
查看time.h, struct tm
中沒有毫秒成員。
我使用ftime進行時間跟蹤( 鏈接文字 )
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.