.. oe:namespace:: OESystem



.. meta::
   :keywords: OEStopwatch, Stopwatch


.. _OESystem_OEStopwatch:

.. oe:class:: OEStopwatch

   .. oe:api::


      class OEStopwatch

   This class represents `OEStopwatch`.

   The :ref:`OEStopwatch <OESystem_OEStopwatch>` class provides a portable
   mechanism for measuring elapsed CPU time of a process.

   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEStopwatch()

      .. oe:language:: python

         .. oe:api:: python

            OEStopwatch() -> OEStopwatch

      Default constructor.

   .. oe:method:: Elapsed

      .. oe:language:: c++ java csharp

         .. oe:api::

            float Elapsed()

      .. oe:language:: python

         .. oe:api:: python

            Elapsed() -> float

      Returns the number of elapsed CPU seconds (as a floating point
      value) since :oe:meth:`OESystem::OEStopwatch::Start` was last
      called. This method is identical to
      :oe:meth:`OESystem::OEStopwatch::Lap`. This method does not
      update the internal 'start' time.

   .. oe:method:: Lap

      .. oe:language:: c++ java csharp

         .. oe:api::

            float Lap()

      .. oe:language:: python

         .. oe:api:: python

            Lap() -> float

      Returns the number of elapsed CPU seconds (as a floating point
      value) since :oe:meth:`OESystem::OEStopwatch::Start` was last
      called. This method is identical to
      :oe:meth:`OESystem::OEStopwatch::Elapsed`. This method does not
      update the internal 'start' time.

   .. oe:method:: Start

      .. oe:language:: c++ java csharp

         .. oe:api::

            void Start()

      .. oe:language:: python

         .. oe:api:: python

            Start() -> None

      Sets the internal 'start' time of the
      :ref:`OEStopwatch <OESystem_OEStopwatch>` to the current time. This method
      should be called before calling either
      :oe:meth:`OESystem::OEStopwatch::Elapsed` or
      :oe:meth:`OESystem::OEStopwatch::Lap`. This method may be called
      more than once to reinitialize the 'start' time to the current
      time.
