NAMD
wkfutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  *cr
3  *cr (C) Copyright 1995-2009 John E. Stone
4  *cr
5  ***************************************************************************/
6 /***************************************************************************
7  * RCS INFORMATION:
8  *
9  * $RCSfile: wkfutils.h,v $
10  * $Author: dhardy $ $Locker: $ $State: Exp $
11  * $Revision: 1.1 $ $Date: 2011/08/14 13:49:14 $
12  *
13  ***************************************************************************/
14 /*
15  * Copyright (c) 1994-2009 John E. Stone
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms, with or without
19  * modification, are permitted provided that the following conditions
20  * are met:
21  * 1. Redistributions of source code must retain the above copyright
22  * notice, this list of conditions and the following disclaimer.
23  * 2. Redistributions in binary form must reproduce the above copyright
24  * notice, this list of conditions and the following disclaimer in the
25  * documentation and/or other materials provided with the distribution.
26  * 3. The name of the author may not be used to endorse or promote products
27  * derived from this software without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
30  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
33  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39  * SUCH DAMAGE.
40  */
41 
42 #ifndef WKF_UTILS_INC
43 #define WKF_UTILS_INC 1
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 typedef void * wkf_timerhandle;
50 wkf_timerhandle wkf_timer_create(void);
51 void wkf_timer_destroy(wkf_timerhandle);
52 void wkf_timer_start(wkf_timerhandle);
53 void wkf_timer_stop(wkf_timerhandle);
54 double wkf_timer_time(wkf_timerhandle);
55 double wkf_timer_timenow(wkf_timerhandle);
56 double wkf_timer_start_time(wkf_timerhandle);
57 double wkf_timer_stop_time(wkf_timerhandle);
59 typedef struct {
60  wkf_timerhandle timer;
61  double updatetime;
62 } wkfmsgtimer;
63 
65 extern wkfmsgtimer * wkf_msg_timer_create(double updatetime);
66 
68 extern int wkf_msg_timer_timeout(wkfmsgtimer *time);
69 
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif
double wkf_timer_time(wkf_timerhandle v)
Definition: wkfutils.c:134
void * wkf_timerhandle
Definition: wkfutils.h:49
void wkf_timer_destroy(wkf_timerhandle v)
Definition: wkfutils.c:168
double wkf_timer_start_time(wkf_timerhandle v)
Definition: wkfutils.c:142
wkfmsgtimer * wkf_msg_timer_create(double updatetime)
Definition: wkfutils.c:178
wkf_timerhandle wkf_timer_create(void)
Definition: wkfutils.c:161
void wkf_msg_timer_destroy(wkfmsgtimer *mt)
Definition: wkfutils.c:204
void wkf_timer_stop(wkf_timerhandle v)
Definition: wkfutils.c:129
wkf_timerhandle timer
Definition: wkfutils.h:60
double updatetime
Definition: wkfutils.h:61
void wkf_timer_start(wkf_timerhandle v)
Definition: wkfutils.c:124
double wkf_timer_timenow(wkf_timerhandle v)
Definition: wkfutils.c:172
int wkf_msg_timer_timeout(wkfmsgtimer *mt)
Definition: wkfutils.c:190
double wkf_timer_stop_time(wkf_timerhandle v)
Definition: wkfutils.c:150