/* $Id: mcl_time.h,v 1.1.1.1 2003/09/03 12:45:44 chneuman Exp $ */ /* * Copyright (c) 1999-2003 INRIA - Universite Paris 6 - All rights reserved * (main author: Vincent Roca - vincent.roca@inrialpes.fr) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ #ifndef MCL_TIME_H /* { */ #define MCL_TIME_H /* * Internal MCL time representation is in milli-seconds (ms) * Being stored in a signed 32 bit int, it will cycle after 596h31 */ typedef int mcl_itime_t; /* define for optimized time management functions */ #define ITIME_FUNCTION_DEFINES #ifdef ITIME_FUNCTION_DEFINES #define mcl_usec2it(from) ((int)((from) / 1000)) #define mcl_it2usec(from) ((from) * 1000) #define mcl_it2sec(from) ((float)(from) * 0.001) #define mcl_itime_sub(val,decr) ((val) - (decr)) #define mcl_itime_add(val,incr) ((val) + (incr)); #define mcl_tv2it(tv) ((tv).tv_sec * 1000 + (long)((float)(tv).tv_usec * 0.001)) #endif /* ITIME_FUNCTION_DEFINES */ #endif /* } MCL_TIME_H */