00001 /****************************************************************************************/ 00002 /* TSC */ 00003 /* */ 00004 /* Author: Charles Bloom */ 00005 /* Description: tsc accessors */ 00006 /* */ 00007 /* The contents of this file are subject to the Genesis3D Public License */ 00008 /* Version 1.01 (the "License"); you may not use this file except in */ 00009 /* compliance with the License. You may obtain a copy of the License at */ 00010 /* http://www.genesis3d.com */ 00011 /* */ 00012 /* Software distributed under the License is distributed on an "AS IS" */ 00013 /* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */ 00014 /* the License for the specific language governing rights and limitations */ 00015 /* under the License. */ 00016 /* */ 00017 /* The Original Code is Genesis3D, released March 25, 1999. */ 00018 /* Genesis3D Version 1.1 released November 15, 1999 */ 00019 /* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */ 00020 /* */ 00021 /****************************************************************************************/ 00022 00023 #ifndef TSC_H 00024 #define TSC_H 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif 00029 00030 /********** 00031 * 00032 00033 routines to access the TSC 00034 will do nothing unless you compile tsc.c with _TSC turned on 00035 00036 to convert clocks to seconds we use this MHZ define: 00037 00038 * 00039 ********/ 00040 00041 #define _TSC_CPU_MHZ 300 00042 00043 // show() will Pop() two and print the delta to log() 00044 // does nothing unless debug is on 00045 00046 extern void pushTSC(void); 00047 00048 // the pop reads once & pop once & take difference 00049 00050 extern double popTSC(void); 00051 extern void showPopTSC(const char *tag); 00052 extern void showPopTSCper(const char *tag,int items,const char *itemTag); 00053 00054 // primitives 00055 00056 typedef unsigned long tsc_type [2]; 00057 00058 extern void readTSC(unsigned long *tsc); 00059 extern double diffTSC(unsigned long *tsc1,unsigned long*tsc2); 00060 00061 #ifdef __cplusplus 00062 } 00063 #endif 00064 00065 #endif
1.3.2