timer_api.h 607 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _TIMER_API_H_
  6. #define _TIMER_API_H_
  7. #include "bh_platform.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. typedef unsigned int timer_id_t;
  12. timer_id_t
  13. wasm_create_timer(int interval, bool is_period, bool auto_start);
  14. void
  15. wasm_timer_destroy(timer_id_t timer_id);
  16. void
  17. wasm_timer_cancel(timer_id_t timer_id);
  18. void
  19. wasm_timer_restart(timer_id_t timer_id, int interval);
  20. uint32
  21. wasm_get_sys_tick_ms(void);
  22. #ifdef __cplusplus
  23. }
  24. #endif
  25. #endif /* end of _TIMER_API_H_ */