summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-17 12:49:00 +0000
committerludde <ludde@openttd.org>2005-07-17 12:49:00 +0000
commit3ce9fb6bbd0169ace02f6510b151171d914d4414 (patch)
tree1cf3df059cae271dabad9928b48178f1c0cbec5b
parentb76a0b81585415b36be3f5bf3285b6743a56e895 (diff)
downloadopenttd-3ce9fb6bbd0169ace02f6510b151171d914d4414.tar.xz
(svn r2601) Fix: Added TIC,TOC macros do be able to do profiling easier.
-rw-r--r--functions.h6
-rw-r--r--win32.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/functions.h b/functions.h
index 2387fa19d..74d6980f4 100644
--- a/functions.h
+++ b/functions.h
@@ -126,6 +126,12 @@ static inline TileIndex RandomTile(void) { return TILE_MASK(Random()); }
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);
diff --git a/win32.c b/win32.c
index f6d416833..c84a85066 100644
--- a/win32.c
+++ b/win32.c
@@ -2038,7 +2038,7 @@ static int ParseCommandLine(char *line, char **argv, int max_argc)
#if defined(_MSC_VER)
-static uint64 _declspec(naked) rdtsc(void)
+uint32 _declspec(naked) rdtsc(void)
{
_asm {
rdtsc