// @HEADER // ***************************************************************************** // Teuchos: Common Tools Package // // Copyright 2004 NTESS and the Teuchos contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef TEUCHOS_CTIMEMONITOR_H #define TEUCHOS_CTIMEMONITOR_H /*! \file Teuchos_CTimeMonitor.hpp \brief Timer functions for C that starts and stops timers for C code. */ #ifdef __cplusplus extern "C" { #endif /** \brief Start a timer with a given name and ID. * * \param timerName * [in] Globally unique null-terminated string name of the timer. * This is only significant on the first call. * * \param timerID * [in] On first call, timerID should be less than * 0 On future calls, it should be what was returned by the * first call. * * \returns on first call returnVal gives the ID of a newly created * timer of the given globally unique name timerName. On future * calls, returnVal==timerID. * * \note You can not start the same timer more than once. You must stop a * timer with Teuchos_stopTimer() before you can call this function * to start it again. */ int Teuchos_startTimer( char timerName[], int timerID ); /** \brief Stop a timer that was started with Teuchos_startTimer(). * * \param timerID * [in] Must be the ID returned from a prior call to * Teuchos_startTimer(). * * * Preconditions: