Changeset 231b3fd in mainline for uspace/app/tester/ipc/starve.c


Ignore:
Timestamp:
2018-08-25T21:35:26Z (6 years ago)
Author:
GitHub <noreply@…>
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)
Message:

Merge 3c453534a2b093c8039d8e8059b923c71f3492a3 into e2625b1a1e5a2895b86f0e39c2d70a39e49e042a

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/ipc/starve.c

    re2625b1a r231b3fd  
    2929#include <stdio.h>
    3030#include <stdlib.h>
    31 #include <sys/time.h>
     31#include <time.h>
    3232#include <io/console.h>
    3333#include <async.h>
     
    4343                return "Failed to init connection with console.";
    4444
    45         struct timeval start;
    46         gettimeofday(&start, NULL);
     45        struct timespec start;
     46        getuptime(&start);
    4747
    4848        TPRINTF("Intensive computation shall be imagined (for %ds)...\n", DURATION_SECS);
    4949        TPRINTF("Press a key to terminate prematurely...\n");
    5050        while (true) {
    51                 struct timeval now;
    52                 gettimeofday(&now, NULL);
     51                struct timespec now;
     52                getuptime(&now);
    5353
    54                 if (tv_sub_diff(&now, &start) >= DURATION_SECS * 1000000L)
     54                if (NSEC2SEC(ts_sub_diff(&now, &start)) >= DURATION_SECS)
    5555                        break;
    5656
    5757                cons_event_t ev;
    58                 suseconds_t timeout = 0;
     58                usec_t timeout = 0;
    5959                bool has_event = console_get_event_timeout(console, &ev, &timeout);
    6060                if (has_event && ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) {
Note: See TracChangeset for help on using the changeset viewer.