src/Mayaqua/Tick64.c
// Convert the Tick value to time

Convert the Tick value to time
Convert the Tick value to time
UINT64 Tick64ToTime64(UINT64 tick)
{
	UINT64 ret = 0;
	if (tick == 0)
	{
		return 0;
	}
	LockList(tk64->AdjustTime);
	{
		INT i;
		for (i = ((INT)LIST_NUM(tk64->AdjustTime) - 1); i >= 0; i--)
		{
			ADJUST_TIME *t = LIST_DATA(tk64->AdjustTime, i);
			if (t->Tick <= tick)
			{
				ret = t->Time + (tick - t->Tick);
				break;
			}
		}
	}
	UnlockList(tk64->AdjustTime);
	if (ret == 0)
	{
		ret++;
	}
	return ret;
}
UINT64 Tick64ToTime64 ( UINT64 tick ) { UINT64 ret = 0 ; if ( tick == 0 ) { return 0 ; } LockList ( tk64 -> AdjustTime ) ; { INT i ; for ( i = ( ( INT ) LIST_NUM ( tk64 -> AdjustTime ) - 1 ) ; i >= 0 ; i -- ) { ADJUST_TIME * t = LIST_DATA ( tk64 -> AdjustTime , i ) ; if ( t -> Tick <= tick ) { ret = t -> Time + ( tick - t -> Tick ) ; break ; } } } UnlockList ( tk64 -> AdjustTime ) ; if ( ret == 0 ) { ret ++ ; } return ret ; }
Convert the Tick value to time
Convert the Tick value to time