Add timeouts
This commit is contained in:
+2
-2
@@ -13,9 +13,9 @@ Console.print('Platform: ' + (platformNames[System.platform] || 'Unknown'));
|
||||
// Testing async/await
|
||||
async function testAsync() {
|
||||
Console.print('Testing async/await...');
|
||||
await new Promise(resolve => requestAnimationFrame(resolve));
|
||||
await frame();
|
||||
Console.print('First await done!');
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await timeout(1000);
|
||||
Console.print('Async/await works!');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user