/home/dko/projects/mobilec/trunk/src/security/xyssl-0.7/library/timing.c File Reference

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

Go to the source code of this file.

Data Structures

struct  _hr_time

Defines

#define _CRT_SECURE_NO_DEPRECATE   1

Functions

unsigned long hardclock (void)
 Return the CPU cycle counter value.
unsigned long set_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.

Variables

static int hardclock_init = 0
static struct timeval tv_init
static const char _timing_src [] = "_timing_src"
int alarmed = 0


Define Documentation

#define _CRT_SECURE_NO_DEPRECATE   1

Definition at line 22 of file timing.c.


Function Documentation

unsigned long hardclock ( void   ) 

Return the CPU cycle counter value.

Definition at line 135 of file timing.c.

References tv_init.

Referenced by main().

void set_alarm ( int  seconds  ) 

Setup an alarm clock.

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

Definition at line 227 of file timing.c.

References sighandler().

Referenced by main().

unsigned long set_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 201 of file timing.c.

References _hr_time::start.

static void sighandler ( int  signum  )  [static]

Definition at line 221 of file timing.c.

Referenced by set_alarm().


Variable Documentation

const char _timing_src[] = "_timing_src" [static]

Definition at line 158 of file timing.c.

int alarmed = 0

Definition at line 160 of file timing.c.

Referenced by main().

int hardclock_init = 0 [static]

Definition at line 132 of file timing.c.

struct timeval tv_init [static]

Definition at line 133 of file timing.c.

Referenced by hardclock().


Generated on Fri May 16 14:49:56 2008 for Mobile-C by  doxygen 1.5.4