Commit c2304411 authored by Pavel Pisa's avatar Pavel Pisa
Browse files

driver: add measurement of write access time to userspace test application.

Signed-off-by: Pavel Pisa's avatarPavel Pisa <>
parent 46efeb70
......@@ -302,6 +302,17 @@ int main(int argc, char *argv[])
printf("%d reads takes %ld.%09ld s\n",
i, (long)diff.tv_sec, diff.tv_nsec);
dummy = 0;
clock_gettime(CLOCK_MONOTONIC, &tic);
for (i = 0; i < 1000 * 1000; i++) {
ctu_can_fd_write32(priv, CTU_CAN_FD_FILTER_C_VAL, dummy);
clock_gettime(CLOCK_MONOTONIC, &tac);
timespec_sub(&diff, &tac, &tic);
printf("%d writes takes %ld.%09ld s\n",
i, (long)diff.tv_sec, diff.tv_nsec);
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment