Switch from gettimeofday() to g_get_monotonic_time() calls.
This commit is based on work done by jry@ (but with reduced diff size).
(devc->capture_ratio * 255) / 100, devc);
/* Start acqusition. */
- gettimeofday(&devc->start_tv, 0);
+ devc->start_time = g_get_monotonic_time();
regval = WMR_TRGRES | WMR_SDRAMWRITEEN;
#if ASIX_SIGMA_WITH_TRIGGER
regval |= WMR_TRGEN;
{
struct dev_context *devc;
uint64_t running_msec;
- struct timeval tv;
+ uint64_t current_time;
devc = sdi->priv;
* 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);
uint64_t limit_msec;
uint64_t limit_samples;
uint64_t sent_samples;
- struct timeval start_tv;
+ uint64_t start_time;
int cur_firmware;
int num_channels;
int cur_channels;