Menu

timertt-1.1.0 Released!

A new version of timertt library is released!

The timertt v.1.1 is a lightweight header-only C++ library. All the library code is in single header file timertt/all.hpp. The timertt v.1.1 uses only standard C++11 library. No external dependencies.

The timertt supports timeout-based timers only (e.g. timers which expired after several milliseconds/seconds/minites from activation moment). Wallclock-timers are not supported. The timertt uses several different timers mechanism and can handle tens and hundreds of millions of timers.

The timertt v.1.1 is being tested by Visual C++ 2013 (Windows), GCC 4.9 (Windows, Linux) and Clang 3.5 (Linux). There is no any system dependent code inside timertt so it should be easily ported on any platform with C++11-compilant compiler.

The timertt v.1.1 is distributed under 3-clauses BSD-license.

This version introduces new type of entities: thread_managers. Unlike timer_threads timer_managers do not create additional working thread for handling timers and executing timer actions. A set of methods is provided instead. User can call this methods in its own event-loop. It can look like:

using namespace std;
using namespace chrono;
using namespace timertt;

timer_heap_manager_template< thread_safety::unsafe > tm;

tm.activate( milliseconds(100), []{ std::cout << "hello!" << std::endl; } );
tm.activate( milliseconds(200), []{ std::cout << "hello!" << std::endl; } );

auto stop_point = system_clock::now() + milliseconds(300);
while( stop_point > system_clock::now() )
{
  tm.process_expired_timers();
  this_thread::sleep_for(
        tm.timeout_before_nearest_timer( milliseconds(10) ) );
}

Archives with version 1.1.0 code can be found in Files section.

Documentation for the new version can be found Wiki.

Posted by Yauheni Akhotnikau 2014-11-25

Log in to post a comment.