Nota:
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
The following procedure shows how to calculate the difference between two CTime objects and get a CTimeSpan result.
To calculate elapsed time
Use the CTime and CTimeSpan objects to calculate the elapsed time, as follows:
CTime startTime = CTime::GetCurrentTime(); // ... perform time-consuming task ... CTime endTime = CTime::GetCurrentTime(); CTimeSpan elapsedTime = endTime - startTime;Once you have calculated
elapsedTime, you can use the member functions of CTimeSpan to extract the components of the elapsed-time value.