#include <xtd/timers/timer>
#include <xtd/console>
#include <xtd/date_time>
#include <xtd/startup>
namespace timer_example {
class program {
public:
static void main() {
set_timer();
a_timer.stop();
a_timer.close();
}
static void set_timer() {
a_timer.elapsed += on_timed_event;
a_timer.auto_reset(true);
a_timer.enabled(true);
}
e.signal_time(),
e.signal_time().millisecond());
}
private:
inline static timer a_timer {2'000};
};
}
static xtd::string read_line()
Reads the next line of characters from the standard input stream.
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
static date_time now() noexcept
Gets a xtd::date_time object that is set to the current date and time on this computer,...
Provides data for the xtd::timers::timer::elapsed event.
Definition elapsed_event_args.hpp:18
Generates an event after a set interval, with an option to generate recurring events.
Definition timer.hpp:50
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
@ e
The E key.
Definition console_key.hpp:96
Provides the xtd::timers::timer component, which allows you to raise an event on a specified interval...
Definition elapsed_event_args.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8