/*1* Copyright 2014 The Emscripten Authors. All rights reserved.2* Emscripten is available under two separate licenses, the MIT license and the3* University of Illinois/NCSA Open Source License. Both these licenses can be4* found in the LICENSE file.5*/67#include <stdio.h>8#include <emscripten.h>910int times = 0;1112void later(void* nada) {13REPORT_RESULT(times);14}1516void main_loop(void) {17static int cnt = 0;18if (++cnt >= 10) emscripten_cancel_main_loop();19}2021int main(void) {22emscripten_async_call(later, NULL, 2000);23times++;24printf("This should only appear once.\n");25emscripten_set_main_loop(main_loop, 10, 0);26return 0;27}282930