|
Blender
V2.59
|
00001 /* 00002 * @file PIL_time.h 00003 * 00004 * Platform independant time functions. 00005 * $Id: PIL_time.h 35587 2011-03-17 06:57:12Z campbellbarton $ 00006 * 00007 * ***** BEGIN GPL LICENSE BLOCK ***** 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License 00011 * as published by the Free Software Foundation; either version 2 00012 * of the License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software Foundation, 00021 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00022 * 00023 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00024 * All rights reserved. 00025 * 00026 * The Original Code is: all of this file. 00027 * 00028 * Contributor(s): none yet. 00029 * 00030 * ***** END GPL LICENSE BLOCK ***** 00031 */ 00032 00038 #ifndef PIL_TIME_H 00039 #define PIL_TIME_H 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 extern 00051 double PIL_check_seconds_timer (void); 00052 00057 void PIL_sleep_ms (int ms); 00058 00063 #define TIMEIT_START(var) \ 00064 { \ 00065 double _timeit_##var= PIL_check_seconds_timer(); \ 00066 printf("time start (" #var "): " AT "\n"); \ 00067 fflush(stdout); \ 00068 { \ 00069 00070 00071 #define TIMEIT_VALUE(var) (float)(PIL_check_seconds_timer() - _timeit_##var) 00072 00073 00074 #define TIMEIT_END(var) \ 00075 } \ 00076 printf("time end (" #var "): %.6f" " " AT "\n", TIMEIT_VALUE(var)); \ 00077 fflush(stdout); \ 00078 } \ 00079 00080 #ifdef __cplusplus 00081 } 00082 #endif 00083 00084 #endif /* !PIL_TIME_H */