Skip to content

Commit 9f4cb90

Browse files
author
Roberto De Ioris
authored
Update AsyncIOAndUnrealEngine.md
1 parent 62a03e3 commit 9f4cb90

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tutorials/AsyncIOAndUnrealEngine.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ Basically when you first import this module a new 'ticker' will be registered in
119119

120120
Let's start with the previous timer example:
121121

122+
```python
123+
import asyncio
124+
import unreal_engine as ue
125+
126+
import ue_asyncio
127+
128+
async def simple_timer(frequency):
129+
while True:
130+
await asyncio.sleep(frequency)
131+
ue.log('{0} secondss elapsed'.format(frequency))
132+
133+
new_task = ue_asyncio.loop.create_task(simple_timer(2))
134+
```
135+
122136
## asyncio in your actors
123137

124138
## Additional 'transient' loop engines

0 commit comments

Comments
 (0)