Changeset 1ab8539 in mainline for uspace/app/tester
- Timestamp:
- 2014-11-14T19:16:23Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5042706
- Parents:
- 9696b01
- Location:
- uspace/app/tester/ipc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/ipc/ping_pong.c
r9696b01 r1ab8539 43 43 44 44 struct timeval start; 45 if (gettimeofday(&start, NULL) != 0) { 46 TPRINTF("\n"); 47 return "Failed getting the time"; 48 } 45 gettimeofday(&start, NULL); 49 46 50 47 uint64_t count = 0; 51 48 while (true) { 52 49 struct timeval now; 53 if (gettimeofday(&now, NULL) != 0) { 54 TPRINTF("\n"); 55 return "Failed getting the time"; 56 } 50 gettimeofday(&now, NULL); 57 51 58 52 if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L) -
uspace/app/tester/ipc/starve.c
r9696b01 r1ab8539 40 40 const char *err = NULL; 41 41 console_ctrl_t *console = console_init(stdin, stdout); 42 if (console == NULL) {42 if (console == NULL) 43 43 return "Failed to init connection with console."; 44 }45 44 46 45 struct timeval start; 47 if (gettimeofday(&start, NULL) != 0) { 48 err = "Failed getting the time"; 49 goto leave; 50 } 46 gettimeofday(&start, NULL); 51 47 52 48 TPRINTF("Intensive computation shall be imagined (for %ds)...\n", DURATION_SECS); … … 54 50 while (true) { 55 51 struct timeval now; 56 if (gettimeofday(&now, NULL) != 0) { 57 err = "Failed getting the time"; 58 goto leave; 59 } 52 gettimeofday(&now, NULL); 60 53 61 54 if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L) … … 70 63 } 71 64 } 72 65 73 66 // FIXME - unless a key was pressed, the answer leaked as no one 74 67 // will wait for it. 75 68 // We cannot use async_forget() directly, though. Something like 76 69 // console_forget_pending_kbd_event() shall come here. 77 70 78 71 TPRINTF("Terminating...\n"); 79 80 leave: 72 81 73 console_done(console); 82 74 83 75 return err; 84 76 }
Note:
See TracChangeset
for help on using the changeset viewer.