Created
January 13, 2018 02:08
-
-
Save tbfleming/afca8bfe32656b7c1ca7e1e87c781267 to your computer and use it in GitHub Desktop.
cib demo: emscripten_async_call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Run this multiple times for multiple counters. | |
| // Use the reboot button to stop them all. | |
| #include <emscripten.h> | |
| #include <stdio.h> | |
| int counter = 0; | |
| void timer(void *) { | |
| printf("counter %p: %03d\n", &counter, counter++); | |
| emscripten_async_call(timer, nullptr, 1000); | |
| } | |
| int main() { timer(nullptr); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment