[LTP] [RFC] [PATCH] tst_timer: Add tst_timer_expired_ms()

Cyril Hrubis chrubis@suse.cz
Fri Jun 29 16:06:14 CEST 2018


Hi!
> 
> ACK

Pushed, thanks.

> I'm thinking if it's worth skipping also tst_timer_check(),
> and adding some like "LTP_TIMER_ANY" that would pick first
> available clockid for you.

For the expiration timer we probably want to try the monotonic timer and
if that fail fall back to the realtime. But I wonder if it's a good idea
to invent our specific timer ids. Maybe it would be better to indroduce
tst_timer_start_any() function instead so that we can do:


static void run(void)
{
	tst_timer_start_any();

	while (!tst_timer_expired_ms(5000)) {
		...
	}
}

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list