Changeset a35b458 in mainline for uspace/app/tester/ipc/ping_pong.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/ipc/ping_pong.c
r3061bc1 ra35b458 41 41 { 42 42 TPRINTF("Pinging ns server for %d seconds...", DURATION_SECS); 43 43 44 44 struct timeval start; 45 45 gettimeofday(&start, NULL); 46 46 47 47 uint64_t count = 0; 48 48 while (true) { 49 49 struct timeval now; 50 50 gettimeofday(&now, NULL); 51 51 52 52 if (tv_sub_diff(&now, &start) >= DURATION_SECS * 1000000L) 53 53 break; 54 54 55 55 size_t i; 56 56 for (i = 0; i < COUNT_GRANULARITY; i++) { 57 57 errno_t retval = ns_ping(); 58 58 59 59 if (retval != EOK) { 60 60 TPRINTF("\n"); … … 62 62 } 63 63 } 64 64 65 65 count += COUNT_GRANULARITY; 66 66 } 67 67 68 68 TPRINTF("OK\nCompleted %" PRIu64 " round trips in %u seconds, %" PRIu64 " rt/s.\n", 69 69 count, DURATION_SECS, count / DURATION_SECS); 70 70 71 71 return NULL; 72 72 }
Note:
See TracChangeset
for help on using the changeset viewer.