-
Notifications
You must be signed in to change notification settings - Fork 52
Timer
Sangmin Seo edited this page Mar 3, 2017
·
3 revisions
This group is for timer.
double ABT_get_wtime(void)
- Get elapsed wall clock time.
- Return value
- Elapsed wall clock time in seconds.
- Details
-
ABT_get_wtime()
returns the elapsed wall clock time in seconds since an arbitrary time in the past. The resolution of elapsed time is at least a unit of microsecond.
-
int ABT_timer_create(ABT_timer *newtimer)
- Create a new timer.
- Parameter
- [out]
newtimer
: handle to a new timer
- [out]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_create()
creates a new timer object and returns its handle throughnewtimer
. If an error occurs in this function, a non-zero error code will be returned andnewtimer
will be set toABT_TIMER_NULL
.
-
int ABT_timer_dup(ABT_timer timer, ABT_timer *newtimer)
- Duplicate the timer.
- Parameters
- [in]
timer
: handle to the timer to be duplicated - [out]
newtimer
: handle to a new timer
- [in]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_dup()
creates a new timer and copies the time values from the timer oftimer
to the new timer. The handle of new timer will be returned throughnewtimer
. If an error occurs in this function, a non-zero error code will be returned andnewtimer
will be set toABT_TIMER_NULL
.
-
int ABT_timer_free(ABT_timer *timer)
- Free the timer object.
- Parameters
- [in,out]
timer
: handle to the timer
- [in,out]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_free()
deallocates the memory used for the timer object associated with the handletimer
. If it is successfully processed,timer
is set toABT_TIMER_NULL
. Using the timer handle after callingABT_timer_free()
may cause undefined behavior.
-
int ABT_timer_start(ABT_timer timer)
- Start the timer.
- Parameters
- [in]
timer
: handle to the timer
- [in]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_start()
starts the timer and saves the time when this function is called. When this function is called multiple times, the time of last call is only kept.
-
int ABT_timer_stop(ABT_timer timer)
- Stop the timer.
- Parameters
- [in]
timer
: handle to the timer
- [in]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_stop()
stops the timer and saves the time when this function is called. When this function is called multiple times, the time of last call is only kept.
-
int ABT_timer_read(ABT_timer timer, double *secs)
- Read the elapsed time of the timer.
- Parameters
- [in]
timer
: handle to the timer - [out]
secs
: elapsed time in seconds
- [in]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_read()
returns the time difference in seconds between the start time oftimer
(when ABT_timer_start() was called) and the end time oftimer
(when ABT_timer_stop() was called) throughsecs
. The resolution of elapsed time is at least a unit of microsecond.
-
int ABT_timer_stop_and_read(ABT_timer timer, double *secs)
- Stop the timer and read the elapsed time of the timer.
- Parameters
- [in]
timer
: handle to the timer - [out]
secs
: elapsed time in seconds
- [in]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_stop_and_read()
stops the timer and returns the time difference in seconds between the start time oftimer
(when ABT_timer_start() was called) and the end time oftimer
(when this function was called) throughsecs
. The resolution of elapsed time is at least a unit of microsecond.
-
int ABT_timer_stop_and_add(ABT_timer timer, double *secs)
- Stop the timer and add the elapsed time of the timer.
- Parameters
- [in]
timer
: handle to the timer - [in,out]
secs
: accumulated elapsed time in seconds
- [in]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_stop_and_add()
stops the timer and adds the time difference between the start time oftimer
(when ABT_timer_start() was called) and the end time oftimer
(when this function was called) tosecs
. That is, the elapsed time of the timer is accumulated insecs
. The resolution of elapsed time is at least a unit of microsecond.
-
int ABT_timer_get_overhead(double *overhead)
- Obtain the overhead time of using ABT_timer.
- Parameter
- [out]
overhead
: overhead time of ABT_timer
- [out]
- Return values
- On success,
ABT_SUCCESS
is returned. - On error, a non-zero error code is returned.
- On success,
- Details
-
ABT_timer_get_overhead()
returns the overhead time when measuring the elapsed time withABT_timer
. It computes the time difference in consecutive calls of ABT_timer_start() and ABT_timer_stop(). The resolution of overhead time is at least a unit of microsecond.
-