diff options
author | Nikolai Kondrashov <spbnick@gmail.com> | 2010-07-24 14:40:16 +0000 |
---|---|---|
committer | Nikolai Kondrashov <spbnick@gmail.com> | 2010-07-24 14:40:16 +0000 |
commit | 6b9204eee7a20d4fd81674e6b9a7ab541c390b8e (patch) | |
tree | 33b96e5cf103eeb002d315b9113b502f8fc81c0c | |
parent | ba6730adb30dd32c2110659e6477b76d377e2174 (diff) | |
download | usbhid-dump-6b9204eee7a20d4fd81674e6b9a7ab541c390b8e.tar.gz |
Added timestamp to dumps.
-rw-r--r-- | src/hid-dump.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/hid-dump.c b/src/hid-dump.c index a04433f..66d118c 100644 --- a/src/hid-dump.c +++ b/src/hid-dump.c @@ -150,8 +150,14 @@ dump(uint8_t iface_num, static char buf[] = " XX\n"; size_t pos; uint8_t b; + struct timeval tv; - fprintf(stdout, "%.3hhu:%s\n", iface_num, entity); + gettimeofday(&tv, NULL); + + fprintf(stdout, "%.3hhu:%-16s %20llu.%.6u\n", + iface_num, entity, + (unsigned long long int)tv.tv_sec, + (unsigned int)tv.tv_usec); for (pos = 1; len > 0; len--, ptr++, pos++) { |