ostime.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
- /*
- * ostime.h
- *
- * Copyright (C) SGS-THOMSON Microelectronics Ltd. 1997
- *
- * Time handling.
- */
- #ifndef __os20_time_h
- #define __os20_time_h
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifndef __clock_t
- #define __clock_t
- typedef unsigned int clock_t;
- #endif
- #ifdef OS20_LOCAL_TIME
- extern clock_t _ST_TimeoutImmediate;
- extern clock_t _ST_TimeoutInfinity;
- #define TIMEOUT_IMMEDIATE (&_ST_TimeoutImmediate)
- #define TIMEOUT_INFINITY (&_ST_TimeoutInfinity)
- #else
- #define TIMEOUT_IMMEDIATE (&time_pointers()[0])
- #define TIMEOUT_INFINITY (&time_pointers()[1])
- #endif
- #ifdef __CORE__
- #pragma ST_translate(time_now, "time_now%os")
- #pragma ST_translate(time_after, "time_after%os")
- #pragma ST_translate(time_minus, "time_minus%os")
- #pragma ST_translate(time_plus, "time_plus%os")
- #pragma ST_translate(time_format, "time_format%os")
- #pragma ST_translate(time_pointers, "time_pointers%os")
- #pragma ST_translate(time_ticks_per_sec_set, "time_ticks_per_sec_set%os")
- #pragma ST_translate(time_ticks_per_sec, "time_ticks_per_sec%os")
- #else
- #pragma IMS_translate(time_now, "time_now%os")
- #pragma IMS_translate(time_after, "time_after%os")
- #pragma IMS_translate(time_minus, "time_minus%os")
- #pragma IMS_translate(time_plus, "time_plus%os")
- #pragma IMS_translate(time_format, "time_format%os")
- #pragma IMS_translate(time_pointers, "time_pointers%os")
- #pragma IMS_translate(time_ticks_per_sec_set, "time_ticks_per_sec_set%os")
- #pragma IMS_translate(time_ticks_per_sec, "time_ticks_per_sec%os")
- #endif
- clock_t time_now (void);
- int time_after (clock_t Time1, clock_t Time2);
- clock_t time_minus (clock_t Time1, clock_t Time2);
- clock_t time_plus (clock_t Time1, clock_t Time2);
- const char* time_format(clock_t Time);
- clock_t* time_pointers(void);
- void time_ticks_per_sec_set(clock_t tps);
- clock_t time_ticks_per_sec(void);
- #ifdef __cplusplus
- }
- #endif
- #endif /* __os20_time_h */