181c78d482
This enforces the use of unsigned 64-bit values for time in the duration type, the timeout framework, the timer session, the userland timer-drivers, and the alarm framework on all platforms. The commit also adapts the code that uses these tools accross all basic repositories (base, base-*, os. gems, libports, ports, dde_*) to use unsigned 64-bit values for time as well as far as this does not imply profound modifications. Fixes #3208
44 lines
849 B
C++
44 lines
849 B
C++
/*
|
|
* \brief Timer accuracy test
|
|
* \author Norman Feske
|
|
* \author Martin Stein
|
|
* \date 2010-03-09
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2010-2017 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
/* Genode includes */
|
|
#include <timer_session/connection.h>
|
|
#include <base/component.h>
|
|
|
|
using namespace Genode;
|
|
|
|
|
|
struct Main
|
|
{
|
|
Timer::Connection timer;
|
|
Signal_handler<Main> timer_handler;
|
|
uint64_t duration_us { 0 };
|
|
|
|
void handle_timer()
|
|
{
|
|
duration_us += 1000 * 1000;
|
|
timer.trigger_once(duration_us);
|
|
log("");
|
|
}
|
|
|
|
Main(Env &env) : timer(env), timer_handler(env.ep(), *this, &Main::handle_timer)
|
|
{
|
|
timer.sigh(timer_handler);
|
|
handle_timer();
|
|
}
|
|
};
|
|
|
|
|
|
void Component::construct(Env &env) { static Main main(env); }
|