Skip to content

Commit 9030dfd

Browse files
committed
feat(docs/scripting/cpp/utils): NextTick
1 parent a18220f commit 9030dfd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# NextTick
2+
3+
Calls the specified function on the next server tick.
4+
5+
### Syntax
6+
7+
```cpp
8+
NextTick(std::function<void()> cb)
9+
```
10+
11+
:::note
12+
The function argument also supports lambda function ( \[]\{ ... } ).
13+
:::
14+
15+
### Example
16+
17+
```cpp
18+
void OnPluginStart()
19+
{
20+
NextTick([]() {
21+
print("Called on the first server tick!\n")
22+
});
23+
}
24+
```

0 commit comments

Comments
 (0)