Skip to content

Commit 10ed8f6

Browse files
committed
README: document ticks() and tick<void>()
1 parent 109f88e commit 10ed8f6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@ timer.in(1000, [](void*) -> bool { return false; });
6262
timer.in(1000, [](void *argument) -> bool { return argument; }, argument);
6363
```
6464
65+
Getting the number of **ticks** until the next *Task*
66+
```cpp
67+
auto ticks = timer.ticks(); // usefull for sleeping until the next task
68+
```
69+
```cpp
70+
void loop {
71+
auto ticks = timer.tick(); // returns the number of ticks
72+
}
73+
```
74+
75+
Avoiding **ticks** calculation inside of **tick**
76+
```cpp
77+
void loop {
78+
timer.tick<void>(); // avoids ticks() calculation
79+
}
80+
```
81+
6582
### API
6683

6784
```cpp

0 commit comments

Comments
 (0)