Changeset 231b3fd in mainline for uspace/app/tester/ipc/starve.c
- Timestamp:
- 2018-08-25T21:35:26Z (6 years ago)
- Parents:
- e2625b1a (diff), 3c45353 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Jakub Jermář <jakub@…> (2018-08-25 21:35:26)
- git-committer:
- GitHub <noreply@…> (2018-08-25 21:35:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/ipc/starve.c
re2625b1a r231b3fd 29 29 #include <stdio.h> 30 30 #include <stdlib.h> 31 #include < sys/time.h>31 #include <time.h> 32 32 #include <io/console.h> 33 33 #include <async.h> … … 43 43 return "Failed to init connection with console."; 44 44 45 struct time valstart;46 get timeofday(&start, NULL);45 struct timespec start; 46 getuptime(&start); 47 47 48 48 TPRINTF("Intensive computation shall be imagined (for %ds)...\n", DURATION_SECS); 49 49 TPRINTF("Press a key to terminate prematurely...\n"); 50 50 while (true) { 51 struct time valnow;52 get timeofday(&now, NULL);51 struct timespec now; 52 getuptime(&now); 53 53 54 if ( tv_sub_diff(&now, &start) >= DURATION_SECS * 1000000L)54 if (NSEC2SEC(ts_sub_diff(&now, &start)) >= DURATION_SECS) 55 55 break; 56 56 57 57 cons_event_t ev; 58 suseconds_t timeout = 0;58 usec_t timeout = 0; 59 59 bool has_event = console_get_event_timeout(console, &ev, &timeout); 60 60 if (has_event && ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) {
Note:
See TracChangeset
for help on using the changeset viewer.