Changeset 2d11a7d8 in mainline for uspace/app/tester/ipc/ping_pong.c
- Timestamp:
- 2009-06-30T15:54:14Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c40f883
- Parents:
- db24058
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/ipc/ping_pong.c
rdb24058 r2d11a7d8 38 38 #define COUNT_GRANULARITY 100 39 39 40 char *test_ping_pong( bool quiet)40 char *test_ping_pong(void) 41 41 { 42 printf("Pinging ns server for %d seconds...\n", DURATION_SECS);42 TPRINTF("Pinging ns server for %d seconds...", DURATION_SECS); 43 43 44 44 struct timeval start; 45 if (gettimeofday(&start, NULL) != 0) 46 return "Failed getting the time."; 45 if (gettimeofday(&start, NULL) != 0) { 46 TPRINTF("\n"); 47 return "Failed getting the time"; 48 } 47 49 48 50 uint64_t count = 0; 49 50 51 while (true) { 51 52 struct timeval now; 52 if (gettimeofday(&now, NULL) != 0) 53 return "Failed getting the time."; 53 if (gettimeofday(&now, NULL) != 0) { 54 TPRINTF("\n"); 55 return "Failed getting the time"; 56 } 54 57 55 58 if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L) … … 60 63 int retval = async_req_0_0(PHONE_NS, NS_PING); 61 64 62 if (retval != EOK) 63 return "Failed to send ping message."; 65 if (retval != EOK) { 66 TPRINTF("\n"); 67 return "Failed to send ping message"; 68 } 64 69 } 65 70 … … 67 72 } 68 73 69 printf("Completed %lu round trips in %u seconds, %lu RT/s.\n",74 TPRINTF("OK\nCompleted %llu round trips in %u seconds, %llu rt/s.\n", 70 75 count, DURATION_SECS, count / DURATION_SECS); 71 76
Note:
See TracChangeset
for help on using the changeset viewer.