1. 程式人生 > >核心模組中計算執行時間

核心模組中計算執行時間

u64 b, e,a;
b = get_cycles();
........
e = get_cycles();
a = e - b 

if (a >= 50000000 * 20)
    pr_info("free cost %llus\n", (e - b) / 50000000);

https://www.ibm.com/developerworks/cn/linux/1307_liuming_linuxtime1/index.html