Skip to content

Commit bb7b523

Browse files
committed
更新 rt_tick_get_delta
1 parent 0a263cb commit bb7b523

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/clock.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,11 @@ RTM_EXPORT(rt_tick_get);
8282
*/
8383
rt_tick_t rt_tick_get_delta(rt_tick_t base)
8484
{
85-
rt_tick_t delta;
8685
rt_tick_t tnow = rt_tick_get();
8786
if (tnow >= base)
88-
delta = tnow - base;
89-
else
90-
delta = RT_TICK_MAX - base + tnow + 1;
91-
return delta;
87+
return tnow - base;
88+
89+
return RT_TICK_MAX - base + tnow + 1;
9290
}
9391
RTM_EXPORT(rt_tick_get_delta);
9492

0 commit comments

Comments
 (0)