/home/dko/Projects/mobilec/src/security/xyssl-0.9/library/timing.c File Reference

#include "xyssl/config.h"
#include "xyssl/timing.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <signal.h>
#include <time.h>

Go to the source code of this file.

Data Structures

struct  _hr_time

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
int alarmed = 0

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 225 of file timing.c.

References _hr_time::start.

Referenced by ssl_test().

unsigned long hardclock ( void   ) 

Return the CPU cycle counter value.

Definition at line 155 of file timing.c.

References tv_init.

Referenced by main().

void m_sleep ( int  milliseconds  ) 

Sleep for a certain amount of time.

Definition at line 258 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 251 of file timing.c.

References sighandler().

Referenced by main().

static void sighandler ( int  signum  )  [static]

Definition at line 245 of file timing.c.

Referenced by set_alarm().


Variable Documentation

int alarmed = 0

Definition at line 179 of file timing.c.

Referenced by main().

int hardclock_init = 0 [static]

Definition at line 152 of file timing.c.

struct timeval tv_init [static]

Definition at line 153 of file timing.c.

Referenced by hardclock().

Generated on Tue Dec 28 15:15:29 2010 for Mobile-C by  doxygen 1.6.3