Skip to content

davepmiller/hourglass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status License

hourglass

async timer

Install

$ git clone https://github.com/DaveyLaser/hourglass.git
$ cd hourglass
$ mkdir build && cd build
$ cmake ..
$ make

Hello World

$ cd examples/hello
$ mkdir build && cd build && cmake .. && make
$ ./hello
#include <iostream>
#include "timer.hpp"

struct Observer
{
    Observer() : count( 0 ) {}
    int count;
    void cb () 
    {
        std::cout << "Hello world, for the " << count++ << "th time!\n";
    }
};

int main()
{
    Observer o;
    hourglass::Timer t;
    t.connect( o, &Observer::cb );
    t.start( 200 /*ms*/ );
    hourglass::sleep( hourglass::seconds( 1 ) );
}

Releases

No releases published

Packages

No packages published