summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_spf.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-01-24 11:43:32 -0500
committerGitHub <noreply@github.com>2017-01-24 11:43:32 -0500
commitac9ddce37d16af4e36c1ff945c12aaaf615e69d8 (patch)
tree4987937426f56c881cb2a83e607924c0103ab3b4 /ospf6d/ospf6_spf.c
parente5951aa21dda9f8c9e87a8b892ae42a531e4e9f4 (diff)
parent39cea8220a9bcc51d97a7832760591e117cdde7a (diff)
Merge pull request #104 from opensourcerouting/time-cleanup
Time cleanup
Diffstat (limited to 'ospf6d/ospf6_spf.c')
-rw-r--r--ospf6d/ospf6_spf.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 04519e7d46..333ce5588e 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -603,7 +603,7 @@ ospf6_spf_calculation_thread (struct thread *t)
ospf6->t_spf_calc = NULL;
/* execute SPF calculation */
- quagga_gettime (QUAGGA_CLK_MONOTONIC, &start);
+ monotime(&start);
if (ospf6_is_router_abr (ospf6))
ospf6_abr_range_reset_cost (ospf6);
@@ -644,7 +644,7 @@ ospf6_spf_calculation_thread (struct thread *t)
if (ospf6_is_router_abr (ospf6))
ospf6_abr_defaults_to_stub (ospf6);
- quagga_gettime (QUAGGA_CLK_MONOTONIC, &end);
+ monotime(&end);
timersub (&end, &start, &runtime);
ospf6->ts_spf_duration = runtime;
@@ -670,7 +670,6 @@ void
ospf6_spf_schedule (struct ospf6 *ospf6, unsigned int reason)
{
unsigned long delay, elapsed, ht;
- struct timeval now, result;
ospf6_set_spf_reason(ospf6, reason);
@@ -694,11 +693,7 @@ ospf6_spf_schedule (struct ospf6 *ospf6, unsigned int reason)
return;
}
- /* XXX Monotic timers: we only care about relative time here. */
- now = recent_relative_time ();
- timersub (&now, &ospf6->ts_spf, &result);
-
- elapsed = (result.tv_sec * 1000) + (result.tv_usec / 1000);
+ elapsed = monotime_since(&ospf6->ts_spf, NULL) / 1000LL;
ht = ospf6->spf_holdtime * ospf6->spf_hold_multiplier;
if (ht > ospf6->spf_max_holdtime)