timing.c File Reference

#include "polarssl/config.h"
#include "polarssl/timing.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <time.h>
Include dependency graph for timing.c:

Go to the source code of this file.

Data Structures

struct  _hr_time

Defines

#define POLARSSL_HAVE_HARDCLOCK

Functions

unsigned long hardclock (void)
 Return the CPU cycle counter value.
unsigned long get_timer (struct hr_time *val, int reset)
 Return the elapsed time in milliseconds.
static void sighandler (int signum)
void set_alarm (int seconds)
 Setup an alarm clock.
void m_sleep (int milliseconds)
 Sleep for a certain amount of time.

Variables

static int hardclock_init = 0
static struct timeval tv_init
volatile int alarmed = 0

Define Documentation

#define POLARSSL_HAVE_HARDCLOCK

Definition at line 192 of file timing.c.


Function Documentation

unsigned long get_timer ( struct hr_time val,
int  reset 
)

Return the elapsed time in milliseconds.

Parameters:
val points to a timer structure
reset if set to 1, the timer is restarted

Definition at line 259 of file timing.c.

References _hr_time::start.

unsigned long hardclock ( void   ) 

Return the CPU cycle counter value.

Definition at line 197 of file timing.c.

References tv_init.

Referenced by hardclock_poll().

void m_sleep ( int  milliseconds  ) 

Sleep for a certain amount of time.

Parameters:
milliseconds delay in milliseconds

Definition at line 300 of file timing.c.

void set_alarm ( int  seconds  ) 

Setup an alarm clock.

Parameters:
seconds delay before the "alarmed" flag is set

Definition at line 293 of file timing.c.

References sighandler().

static void sighandler ( int  signum  )  [static]

Definition at line 287 of file timing.c.

Referenced by set_alarm().


Variable Documentation

volatile int alarmed = 0

Definition at line 213 of file timing.c.

int hardclock_init = 0 [static]

Definition at line 194 of file timing.c.

struct timeval tv_init [static]

Definition at line 195 of file timing.c.

Referenced by hardclock().


Generated on 9 Apr 2014 for PolarSSL v1.3.2 by  doxygen 1.6.1