nh2 / nh2/hemokit

hemokit data has higher time stdev than emokit

Aperta
#5 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Haskell
Stelle
32
Fork
14
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I've taken some rough measurements of how long `emokit_read_data_timeout` and `hemokit-dump`'s main loop take per iteration.

For this I modified:

``` c
int emokit_read_data_timeout(struct emokit_device* s, unsigned timeout)
{
static uint64_t t_before = 0;
struct timeval tv;
gettimeofday(&tv, NULL);
uint64_t t = ((uint64_t) tv.tv_sec)*1000000 + (uint64_t) tv.tv_usec;
fprintf(stderr, "%lu\n", t - t_before);
t_before = t;
return hid_read_timeout(s->_dev, s->raw_frame, 32, timeout);
}
```

Results (times in microseconds):

| | emokit (gettimeofday) | hemokit (getCurrentTime) |
| --- | --- | --- |
| mean | 7818.57 | 7662.45 |
| std | 410.32 | 725.25 |
| std/mean | ~5.2 % | 9.5 % |

So the distance between time measurements varies quite a bit more in Hemokit.

This wasn't measured properly though on the Hemokit side; for it to be a fair comparison, I should measure how long `readEmotivRaw` takes, not the time of a `hemokit-dump` loop.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.