(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
authorludde
Sun, 17 Jul 2005 12:49:00 +0000
changeset 2091 97197b795fe6
parent 2090 9bbad972eb2a
child 2092 c30495feef79
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
functions.h
win32.c
--- a/functions.h	Sun Jul 17 12:44:35 2005 +0000
+++ b/functions.h	Sun Jul 17 12:49:00 2005 +0000
@@ -126,6 +126,12 @@
 uint32 InteractiveRandom(void); /* Used for random sequences that are not the same on the other end of the multiplayer link */
 uint InteractiveRandomRange(uint max);
 
+
+// Used for profiling
+#define TIC() { extern uint32 rdtsc(void); uint32 _xxx_ = rdtsc();
+#define TOC(s) 	_xxx_ = rdtsc() - _xxx_; printf("%s: %d\n", s, _xxx_); }
+
+
 void SetDate(uint date);
 /* facedraw.c */
 void DrawPlayerFace(uint32 face, int color, int x, int y);
--- a/win32.c	Sun Jul 17 12:44:35 2005 +0000
+++ b/win32.c	Sun Jul 17 12:49:00 2005 +0000
@@ -2038,7 +2038,7 @@
 
 
 #if defined(_MSC_VER)
-static uint64 _declspec(naked) rdtsc(void)
+uint32 _declspec(naked) rdtsc(void)
 {
 	_asm {
 		rdtsc