Skip to content

Latest commit

 

History

History
55 lines (49 loc) · 1.45 KB

elapsed-time-general-purpose-classes.md

File metadata and controls

55 lines (49 loc) · 1.45 KB
title Elapsed Time: General-Purpose Classes | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic reference
dev_langs
C++
helpviewer_keywords
adding dates
calculating dates and times
dates, calculating intervals
elapsed time, calculating
elapsed time
time, elapsed
intervals, date and time
calculations, date and time
ms.assetid e5c5d3d2-ce1d-409e-875c-98848434e716
caps.latest.revision 10
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

Elapsed Time: General-Purpose Classes

The following procedure shows how to calculate the difference between two CTime objects and get a CTimeSpan result.

To calculate elapsed time

  1. Use the CTime and CTimeSpan objects to calculate the elapsed time, as follows:

    [!code-cppNVC_ATLMFC_Utilities#174]

    Once you have calculated elapsedTime, you can use the member functions of CTimeSpan to extract the components of the elapsed-time value.

See Also

Date and Time: General-Purpose Classes