# Linux Kernel Module Cheat

#### 7.1.3. time_boot.out

Get a reasonable answer to "how long does boot take in guest time?":

    ./run --eval-after './linux/time_boot.c'

Source: userland/linux/time_boot.c

That executable writes to `dmesg` directly through `/dev/kmsg` a message of type:

    [    2.188242] /path/to/linux-kernel-module-cheat/userland/linux/time_boot.c

which tells us that boot took `2.188242` seconds based on the dmesg timestamp.

Bibliography: https://stackoverflow.com/questions/12683169/measure-time-taken-for-linux-kernel-from-bootup-to-userpace/46517014#46517014