How to get boot time and show it on terminal wtih kernel programming in Linux? -
what i'm thinking getting uptime , current date , time, , subtracting these. i'll convert output output resembles output of "date" command in linux.
but think takes long? , think there might better solution since looks brute force.
-- beginner on kernel programming
try following code
u64 nsec = local_clock(); unsigned long rem_nsec = do_div(nsec, 100000000000); printk("time boot %5lu.%06lu ", (unsigned long)nsec, rem_nsec / 1000);
Comments
Post a Comment