#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <oski/common.h>
#include <oski/timer.h>
#include <oski/config.h>
#include "cycle.h"
#include <time.h>
Data Structures | |
struct | tagBebop_timerstruct_t |
Stores 'stop-watch' timer data. More... | |
Defines | |
#define | TIMER_DESC "ANSI C clock() routine" |
Typedefs | |
typedef clock_t | rawtime_t |
typedef struct tagBebop_timerstruct_t | oski_timerstruct_t |
Stores 'stop-watch' timer data. | |
Functions | |
static rawtime_t | getrawtime (void) |
static double | elapsed (rawtime_t t1, rawtime_t t0) |
double | oski_GetTimerSecsPerTick () |
Get the current calibration factor. | |
static size_t | strlen_ignore_spaces (const char *s) |
void | oski_CalibrateTimer (oski_timer_t timer) |
Initialize timer. | |
oski_timer_t | oski_CreateTimer (void) |
Allocate a new timer. | |
void | oski_DestroyTimer (oski_timer_t timer) |
Free previously allocated timer. | |
const char * | oski_GetTimerDesc (oski_timer_t timer) |
Get a short string description of the timer being used. | |
void | oski_RestartTimer (oski_timer_t timer) |
Start virtual stopwatch. | |
void | oski_StopTimer (oski_timer_t timer) |
Stop virtual stopwatch. | |
double | oski_ReadElapsedTime (oski_timer_t timer) |
Check virtual stopwatch and return elapsed time, in seconds, since the last call to either oski_RestartTimer() or oski_StopTimer(), whichever happened most recently. | |
Variables | |
static double | g_seconds_per_tick = -1 |
Multiplicative factor converting ticks to seconds. |
void oski_CalibrateTimer | ( | oski_timer_t | timer | ) |
Initialize timer.
An application should call this at least once during its start-up to cache calibration results.
References g_seconds_per_tick, INVALID_TIMER, oski_GetTimerDesc(), oski_PrintDebugMessage(), and tagBebop_timerstruct_t::seconds_per_tick.
Referenced by oski_CreateTimer(), and oski_GetTimerSecsPerTick().
const char* oski_GetTimerDesc | ( | oski_timer_t | timer | ) |
double oski_ReadElapsedTime | ( | oski_timer_t | timer | ) |
Check virtual stopwatch and return elapsed time, in seconds, since the last call to either oski_RestartTimer() or oski_StopTimer(), whichever happened most recently.
References tagBebop_timerstruct_t::is_running, tagBebop_timerstruct_t::seconds_per_tick, tagBebop_timerstruct_t::t_end, and tagBebop_timerstruct_t::t_start.
Referenced by ChooseFastest(), main(), MeasureStreamTimeCSR(), oski_MatMult(), oski_MatMultAndMatTransMult(), oski_MatPowMult(), oski_MatTransMatMult(), oski_MatTrisolve(), and oski_TuneMat().