SimApi Timer getPosition

From SIMboxWiki
Jump to navigation Jump to search



Icon attributes.pngstatic int SimApi::Timer::getPosition(const _SYSTEMTIME &i_Time)

    Description

    Gets the percentage value from the total session duration for a specified time value.

    Parameters

    i_Time - - time within the session, for which the position should be calculated

    Return

    Type: int   Description: Session position in persantage of a total session duration. The returned value is in the range of 0-100.

    Code Sample
    

SYSTEMTIME	st;

// Set time to Thursday, 3 Dec 2009, 10:45:00:000
st.wYear         = 2009;
st.wMonth        = 12;   // December
st.wDayOfWeek    = 4;    // Thursday
st.wDay          = 3;
st.wHour         = 10;   // 10 AM
st.wMinute       = 45;
st.wSecond       = 0;
st.wMilliseconds = 0;

// Get corresponding session position
int nSessionPositionInPercents = SimApi::Timer::getPosition(st);


    See Also

     getCurrentPosition

     seekToTimeByPosition

    Related Links

     Recommended: Simulation Time Overview