Linux Device Driver

列印時間


如下:

void print_time(void)
{
    struct timeval t;
    struct tm broken;

    do_gettimeofday(&t);
    time_to_tm(t.tv_sec, 0, &broken);
    printk("%d:%d:%d:%ld\n", broken.tm_hour, broken.tm_min, broken.tm_sec, t.tv_usec);
}


返回上一頁