Skip to content

Commit

Permalink
Added info about lamda
Browse files Browse the repository at this point in the history
  • Loading branch information
berndporr committed Feb 1, 2025
1 parent 7145653 commit 4629378
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,20 @@ then at the specified interval.

To run `demo.cpp` just do `cmake .`, `make` and then `./demo`.

## Callback version
## Callback interface version

Instead of overloading the `run()` method in the timer class you can
overload the `run()` method in the `Runnable` class and then register
this class with the timer class. Check out `demo_runnable` which
demonstrates how to use this method.

## Callback via lambda function

Here, the callback is established with the help of a lambda function
instead of a callback interface. This allows direct registering
of a method of the receiving class but one needs to get used to the
lambda function syntax.

## Unit tests

Run:
Expand Down

0 comments on commit 4629378

Please sign in to comment.