X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fasix-sigma%2Fprotocol.c;h=48de1b954ba4559d1de20f6355335212cffbb2f8;hb=2f425a56edbe528ed4566ea6791009dad61ef56d;hp=60c6a34843c6c415f55df1c02a78bb0f4d589e89;hpb=74d453abfd29f8ea5426c4400f29d30cc18e97dd;p=libsigrok.git diff --git a/src/hardware/asix-sigma/protocol.c b/src/hardware/asix-sigma/protocol.c index 60c6a348..48de1b95 100644 --- a/src/hardware/asix-sigma/protocol.c +++ b/src/hardware/asix-sigma/protocol.c @@ -1138,7 +1138,7 @@ static int sigma_capture_mode(struct sr_dev_inst *sdi) { struct dev_context *devc; uint64_t running_msec; - struct timeval tv; + uint64_t current_time; devc = sdi->priv; @@ -1146,9 +1146,8 @@ static int sigma_capture_mode(struct sr_dev_inst *sdi) * Check if the selected sampling duration passed. Sample count * limits are covered by this enforced timeout as well. */ - gettimeofday(&tv, 0); - running_msec = (tv.tv_sec - devc->start_tv.tv_sec) * 1000 + - (tv.tv_usec - devc->start_tv.tv_usec) / 1000; + current_time = g_get_monotonic_time(); + running_msec = (current_time - devc->start_time) / 1000; if (running_msec >= devc->limit_msec) return download_capture(sdi);