1  /*
2   * Copyright (C) 2015-2018 Alibaba Group Holding Limited
3   */
4  
5  #ifndef _INFRA_TIMER_H_
6  #define _INFRA_TIMER_H_
7  
8  #include "linkkit/infra/infra_types.h"
9  
10  typedef struct {
11      uint32_t time;
12  } iotx_time_t;
13  
14  void iotx_time_start(iotx_time_t *timer);
15  
16  uint32_t utils_time_spend(iotx_time_t *start);
17  
18  uint32_t iotx_time_left(iotx_time_t *end);
19  
20  uint32_t utils_time_is_expired(iotx_time_t *timer);
21  
22  void iotx_time_init(iotx_time_t *timer);
23  
24  void utils_time_countdown_ms(iotx_time_t *timer, uint32_t millisecond);
25  
26  uint32_t utils_time_get_ms(void);
27  
28  #endif /* _IOTX_COMMON_TIMER_H_ */
29