Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/test/browser/test_async.c
4150 views
1
// Copyright 2015 The Emscripten Authors. All rights reserved.
2
// Emscripten is available under two separate licenses, the MIT license and the
3
// University of Illinois/NCSA Open Source License. Both these licenses can be
4
// found in the LICENSE file.
5
6
#include <stdio.h>
7
#include <emscripten.h>
8
#include <assert.h>
9
10
int main() {
11
// infinite main loop, turned async via asyncify
12
int counter = 0;
13
while (1) {
14
printf("frame: %d\n", ++counter);
15
emscripten_sleep(100);
16
if (counter == 10) {
17
return 0;
18
}
19
}
20
__builtin_trap();
21
}
22
23
24