#ifndef V_TIME_H
#define V_TIME_H

#ifdef	__cplusplus
extern "C" {
#endif	/* __cplusplus */
	/* Returns time stamp in milliseconds (common to all threads) */
	u32_t	V_GLOBAL	timeTickCount();
	/* Delays execution of caller */
	void	V_GLOBAL	timeDelay(u32_t Milliseconds);
	/*
	 * Timer object.
	 */
	vhandle_t	V_GLOBAL	timerCreate(void);
	/*
	 * This must be the first call (timers are created in passive state)
	 */
	void	V_GLOBAL	timerStart(vhandle_t timer);
	/*
	 * Sets timer to passive state: subsequent calls of timerMilliseconds()
	 * will return time of this call.
	 */
	void	V_GLOBAL	timerStop(vhandle_t timer);
	/*
	 * Sets timer to active state; subsequent calls of timerMilliseconds()
	 * will return time elapsed since latest call to timerStart().
	 */
	void	V_GLOBAL	timerResume(vhandle_t timer);
	/*
	 * Returns time (in seconds) since last call to 'timerStart'
	 */
	u32_t	V_GLOBAL	timerMilliseconds(vhandle_t timer);
	/*
	 * Returns control back to caller at time 'return_time'.
	 */
	void	V_GLOBAL	timerWait(vhandle_t timer,u32_t return_time);
	/*
	 * Sets float timer rate (time multiplier).
	 * Affects results of the timerTime() and timerDiffTime();
	 * other functions will not affected.
	 */
	void	V_GLOBAL	timerRate(vhandle_t timer,vec_t rate);
	/*
	 * Returns time (in seconds) since last call to 'timerStart'
	 */
	vec_t	V_GLOBAL	timerTime(vhandle_t timer);
	/*
	 * Returns time (in seconds) since last call to 'timerDiffTime'
	 */
	vec_t	V_GLOBAL	timerDiffTime(vhandle_t timer);
	
	void	V_GLOBAL	timerDestroy(vhandle_t timer);
#ifdef	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* V_TIME_H */
