Hi all,
I am trying to use the timer in libev using c++
Here is my code

class Timer {
private:
    ev::timer stopTimer;
public:
    Timer() {
        stopTimer.set<Timer,&Timer::timeout_cb>(this);
        stopTimer.start(0.,5);
    }
    void timeout_cb(ev::timer &watcher, int revents) {
        cout << "TimeOut" << endl;
    }
};

int main(int argc,char **argv) {
    ev::default_loop loop;
    Timer time;
    loop.run(0);
    return 0;
}


Here my problem is the timeout call back function is getting called immediatly 
after the program execution begins instead of getting called after the timer 
has expired
can anyone please help me

Thanks
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to