Defines | Functions | Variables

K:/Projects/scplusplus/gpl_releases/nttw/include/timing.h File Reference

High Resolution Timing Header/Object for the NTTW C Library. More...

#include <time.h>
#include "global.h"
Include dependency graph for timing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define START_TIMER   ( clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &startTime) )
 < Start Timer Macro (Linux)
#define RESTART_TIMER   ( clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &startTime) )
 Stop Timer Macro (Linux).
#define STOP_TIMER   ( clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &stopTime) )
 Time elapsed so far, return timespec struct (Linux).
#define TIME_ELAPSED   ( diff_times(startTime, stopTime) )
 Returns seconds elapsed (Linux).
#define SECONDS_ELAPSED   ( diff_times(startTime, stopTime).tv_sec )
 Return nano-seconds elapsed, use with SECONDS_ELAPSED to get total time (Linux).
#define NANOSECONDS_ELAPSED   ( diff_times(startTime, stopTime).tv_nsec )
 Returns time in milli-seconds (Linux).
#define MILLISECONDS_ELAPSED   ( diff_times(startTime, stopTime).tv_sec*1000ULL + diff_times(startTime, stopTime).tv_nsec/1000000ULL )
 Returns time in micro-seconds (Linux).
#define MICROSECONDS_ELAPSED   ( diff_times(startTime, stopTime).tv_sec*1000000ULL + diff_times(startTime, stopTime).tv_nsec/1000ULL )

Functions

NTTW_DLL_SYM struct timespec diff_times (const struct timespec start, const struct timespec end)

Variables

static struct timespec startTime
 Start Time Global Variable (Linux).
static struct timespec stopTime
 Start Time Global Variable (Linux).

Detailed Description

High Resolution Timing Header/Object for the NTTW C Library.

NTTW High Resolution Timing Module

This file defines the functions that wrap all the OS dependent high resolution timing functions. Only supports Windows and POSIX (including Linux) Operating Systems.

This file is part of NTTW Library.

NTTW is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

NTTW is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with NTTW. If not, see <http://www.gnu.org/licenses/>.

Author:
Shekhar S. Chandra, 2009

Definition in file timing.h.