time.h
Go to the documentation of this file.
#ifndef _VNTIME_H_
#define _VNTIME_H_
#include "vn/int.h"
#include "vn/error.h"
#include "vn/enum.h"
#ifdef _WIN32
/* Disable some warnings for Visual Studio with -Wall. */
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4668)
#pragma warning(disable:4820)
#pragma warning(disable:4255)
#endif
#include <Windows.h>
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
#if _WIN32
double pcFrequency;
__int64 counterStart;
#elif __linux__ || __APPLE__ ||__CYGWIN__ || __QNXNTO__
double clockStart;
#else
#error "Unknown System"
#endif
} VnStopwatch;
VnError VnStopwatch_initializeAndStart(VnStopwatch *stopwatch);
VnError VnStopwatch_reset(VnStopwatch *stopwatch);
VnError VnStopwatch_elapsedMs(VnStopwatch *stopwatch, float *elapsedMs);
#ifdef __cplusplus
}
#endif
#endif
VnStopwatch
Provides simple timing capabilities.
Definition: time.h:37
VnStopwatch_reset
VnError VnStopwatch_reset(VnStopwatch *stopwatch)
Resets the stopwatch's timing.
VnStopwatch_initializeAndStart
VnError VnStopwatch_initializeAndStart(VnStopwatch *stopwatch)
Initializes and starts a stopwatch.
VnStopwatch_elapsedMs
VnError VnStopwatch_elapsedMs(VnStopwatch *stopwatch, float *elapsedMs)
Determines the number of milliseconds elapsed since the last reset of the stopwatch.