Skip to content

Instantly share code, notes, and snippets.

@tbfleming
Created January 13, 2018 02:08
Show Gist options
  • Save tbfleming/afca8bfe32656b7c1ca7e1e87c781267 to your computer and use it in GitHub Desktop.
Save tbfleming/afca8bfe32656b7c1ca7e1e87c781267 to your computer and use it in GitHub Desktop.
cib demo: emscripten_async_call
// 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