aboutsummaryrefslogtreecommitdiff
path: root/src/target/cortex_m.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/cortex_m.c')
-rw-r--r--src/target/cortex_m.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index 24063a7e..79af632a 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -1787,8 +1787,7 @@ int cortex_m_profiling(struct target *target, uint32_t *samples,
gettimeofday(&now, NULL);
- if (sample_count >= max_num_samples ||
- (now.tv_sec >= timeout.tv_sec && now.tv_usec >= timeout.tv_usec)) {
+ if (sample_count >= max_num_samples || timeval_compare(&now, &timeout) > 0) {
LOG_INFO("Profiling completed. %" PRIu32 " samples.", sample_count);
break;
}