#ifndef LSTAT_HEADER
#	define	LSTAT_HEADER

typedef struct {unsigned int start_cpu; int start_elap; } Lkeep;

typedef struct {int k;int cpu,worstcpu; int elap,worstelap; int n;} LStat;
int lstat_start(Lkeep *lk, int x);
int lstat_end(Lkeep *lk, int x);
void lstat_init(void);
int lstat_set_mutex(int (*cb)(int vm, int isget, int seconds), int m);
unsigned int lstat_process_cpu(void);
int lstat_lib_msec(void); 
unsigned int lstat_my_clock(void);
int lstat_reset(void);
int lstat_sort(void);
LStat * lstat_get_sort(int x);
int lstat_cps(void);
int lstat_n(void);
LStat *lstat_get(int x);
int lstat_cpms(void);

/* These functiosn are used to time critical parts of 
your program.

  Declare an enum and name list to use with them e.g.

  enum {T_OPEN,T_READ,T_CLOSE};
  char *tnames[]={"Open","Read","Close"};

  lstat_start(T_OPEN);
  (open the file)
  lstat_end(T_OPEN);
  lstat_start(T_READ);
  (READ THE FILE)
  lstat_end(T_READ);
	
  lstat_sort();
  for (i=0; i<lstat_n(); i++) {
	l = lstat_get(i); (might return them in sorted order)
	printf("%s %g %g %d\n",tnames[l->k],l->cpu,l->elap,l->n);
  }


*/

#endif

