Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_fattime.c
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | main(int argc __unused, char **argv __unused) | ||||
struct tm tm; | struct tm tm; | ||||
double a; | double a; | ||||
uint16_t d, t; | uint16_t d, t; | ||||
uint8_t p; | uint8_t p; | ||||
char buf[100]; | char buf[100]; | ||||
for (i = 0; i < 10000; i++) { | for (i = 0; i < 10000; i++) { | ||||
do { | do { | ||||
ts.tv_sec = random(); | ts.tv_sec = arc4random(); | ||||
} while (ts.tv_sec < T1980 * 86400); | } while (ts.tv_sec < T1980 * 86400); | ||||
ts.tv_nsec = random() % 1000000000; | ts.tv_nsec = arc4random() % 1000000000; | ||||
printf("%10d.%03ld -- ", ts.tv_sec, ts.tv_nsec / 1000000); | printf("%10d.%03ld -- ", ts.tv_sec, ts.tv_nsec / 1000000); | ||||
gmtime_r(&ts.tv_sec, &tm); | gmtime_r(&ts.tv_sec, &tm); | ||||
strftime(buf, sizeof buf, "%Y %m %d %H %M %S", &tm); | strftime(buf, sizeof buf, "%Y %m %d %H %M %S", &tm); | ||||
printf("%s -- ", buf); | printf("%s -- ", buf); | ||||
a = ts.tv_sec + ts.tv_nsec * 1e-9; | a = ts.tv_sec + ts.tv_nsec * 1e-9; | ||||
Show All 25 Lines |