In this recipe, we will take a look at how we can delay the execution after some time in the future by using busy loops or more complex functions that may involve a suspension.
Spending time in the kernel
Getting ready
Even in this recipe, we can use a kernel module to see how a test code works.
How to do it...
In the time.c file, we can find a simple example exemplifying how the preceding functions work:
- As the first step, we declare a utility function to get the execution time in nanoseconds, of a line of code:
#define print_time(str, code) \
do { ...