Re: [問題] 計算時間

看板LinuxDev作者 (rezod)時間18年前 (2007/01/09 23:28), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
我自己還沒試過 但之前有google過 這是其中一個 參考看看吧 http://www.delorie.com/gnu/docs/glibc/libc_436.html ANSI C本身好像沒有支援到msec以下的精確度 但找standard library以外的library應該可以 這個用的是glibc 是linux底下的c stdandard lib 非unix家族的平台應該沒得用 ※ 引述《leslieha (哈)》之銘言: : 計算執行時間 : clock_t t1, t2; : double diff; : t1 = clock(); : funciton(); : t2 = clock(); : diff = (double)(t2 - t1)/CLOCL_PER_SEC; : 精準度可到 msec : windows 有 : QueryPerfromance : 得到CPU clock數 以及 CPU的頻率 : 精準可以到 0.xxxxxx msec : 想請問 : UNIX有其它計算時間的函式 : 可以到 usec 或是 nsec的嗎? -- The inherent vice of capitalism is the unequal sharing of blessings; the inherent virtue of socialism is the equal sharing of misery. -- Churchill -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.126.35.52 ※ 編輯: dozer 來自: 122.126.35.52 (01/09 23:36)
文章代碼(AID): #15exIJFk (LinuxDev)
討論串 (同標題文章)
本文引述了以下文章的的內容:
0
1
以下文章回應了本文
完整討論串 (本文為第 2 之 3 篇):
0
1
文章代碼(AID): #15exIJFk (LinuxDev)