kupl_get_wtime
Get the current time (unit: second).
Interface Definition
int kupl_get_wtime();
Return Value
- Return the current time (unit: second).
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include <stdio.h> #include <assert.h> #include <unistd.h> #include "kupl.h" int main() { double start = kupl_get_wtime(); usleep(1000001); double end = kupl_get_wtime(); assert(end - start >= 1); return 0; } |
- The preceding example demonstrates how to obtain the current time (unit: second).
- The kupl_get_wtime function gets the current time. The time interval is obtained by calculating the difference between the return values of two distinct calls to this function.
Parent topic: Common Functions