Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/crypto.c
Show First 20 Lines • Show All 1,182 Lines • ▼ Show 20 Lines | crypto_tstat(struct cryptotstat *ts, struct bintime *bt) | ||||
binuptime(&now); | binuptime(&now); | ||||
u = now.frac; | u = now.frac; | ||||
delta.frac = now.frac - bt->frac; | delta.frac = now.frac - bt->frac; | ||||
delta.sec = now.sec - bt->sec; | delta.sec = now.sec - bt->sec; | ||||
if (u < delta.frac) | if (u < delta.frac) | ||||
delta.sec--; | delta.sec--; | ||||
bintime2timespec(&delta, &t); | bintime2timespec(&delta, &t); | ||||
timespecadd(&ts->acc, &t); | timespecadd(&ts->acc, &t, &ts->acc); | ||||
if (timespeccmp(&t, &ts->min, <)) | if (timespeccmp(&t, &ts->min, <)) | ||||
ts->min = t; | ts->min = t; | ||||
if (timespeccmp(&t, &ts->max, >)) | if (timespeccmp(&t, &ts->max, >)) | ||||
ts->max = t; | ts->max = t; | ||||
ts->count++; | ts->count++; | ||||
*bt = now; | *bt = now; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 654 Lines • Show Last 20 Lines |