/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2015 Raytrix GmbH. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once

#include "RxCore.h"
#include <cstdint>

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// namespace: Rx
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace Rx
{
	/**
	\addtogroup RxCore
	**/
	/// @{

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Initialize time.
	/// </summary>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RXCORE_API void InitTime();

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Gets the current time in milliseconds as double.
	/// </summary>
	///
	/// <returns> The current time in milliseconds as double. </returns>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RXCORE_API double GetTime();

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Gets the current time in milliseconds as a 64 bit integer.
	/// </summary>
	///
	/// <returns> The current time in milliseconds as a 64 bit integer. </returns>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RXCORE_API int64_t GetTime64();

	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/// <summary>
	/// 	Blocks the execution of the current thread for at least the specified time given in milliseconds.
	///
	/// 	A steady clock is used to measure the duration. This function may block for longer than the given time due to
	/// 	scheduling or resource contention delays.
	/// </summary>
	///
	/// <param name="uTime"> The time to sleep in milliseconds. </param>
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	RXCORE_API void Sleep(unsigned uTime);

	/// @}
}
