#ifndef MPLIB1_STOPWATCH #define MPLIB1_STOPWATCH /* ******************************************************************************* * Copyright (c) 1996 Martin Poole * ******************************************************************************* ** ** WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! ** ** Any changes to be made to this file should first be checked with ** mplib1 source control for library integrity. ** ** mplib1 source control can be reached at mplib1@quatermass.co.uk ** * * $Source$ * $Author$ * $Date$ * $Revision$ * ******************************************************************************* * * Change History * * $Log$ * ******************************************************************************* */ #ident "$Header$" /* ------------------------------------------------------------------ Include files ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ defines ------------------------------------------------------------------ */ struct stopwatch { struct timeval start_time; struct timeval cumulative_time; char elps_str[40]; }; struct cpu_stopwatch { struct stopwatch u_timing; struct stopwatch s_timing; char elps_str[100]; }; /* ------------------------------------------------------------------ Code starts here ------------------------------------------------------------------ */ extern void diff_timevals( struct timeval *end_p, struct timeval *start_p ); extern void add_timevals( struct timeval *cump, struct timeval *tvp ); extern void accum_stop_timevals( struct stopwatch *stp, struct timeval *etp ); extern int init_stopwatch( struct stopwatch *stp ); extern int start_stopwatch( struct stopwatch *stp ); extern int stop_stopwatch( struct stopwatch *stp ); extern int accrete_stopwatch( struct stopwatch *stp_into, struct stopwatch *stp_from ); extern char *display_stopwatch( struct stopwatch *stp, int mode ); extern int init_cpu_stopwatch( struct cpu_stopwatch *cpu_p ); extern int start_cpu_stopwatch( struct cpu_stopwatch *cpu_p ); extern int stop_cpu_stopwatch( struct cpu_stopwatch *cpu_p ); extern int accrete_cpu_stopwatch( struct cpu_stopwatch *stp_into, struct cpu_stopwatch *stp_from ); extern char *display_cpu_stopwatch( struct cpu_stopwatch *stp, int mode ); #endif /* -- End of File -- */