diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-03 01:26:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-05 01:03:26 +0300 |
commit | bc94ad8eb49a67b1202a56f7bb28d8ea605a0b29 (patch) | |
tree | 830fe7dfd98e7fe41c030995accdcadcaac0d560 /src/common | |
parent | f6ee3f1d20596375b2c68c7b7eff4e40008ce9c2 (diff) | |
download | hercules-bc94ad8eb49a67b1202a56f7bb28d8ea605a0b29.tar.gz hercules-bc94ad8eb49a67b1202a56f7bb28d8ea605a0b29.tar.bz2 hercules-bc94ad8eb49a67b1202a56f7bb28d8ea605a0b29.tar.xz hercules-bc94ad8eb49a67b1202a56f7bb28d8ea605a0b29.zip |
Add to system information also information about clock function.
I think issues with stuck skills delay/cooldown related to timers/clock.
This change allow to see with what clock functions issue can be reproduced.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/console.c | 1 | ||||
-rw-r--r-- | src/common/sysinfo.c | 15 | ||||
-rw-r--r-- | src/common/sysinfo.h | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/common/console.c b/src/common/console.c index f0702d0da..10e1bee1a 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -90,6 +90,7 @@ void display_title(void) { ShowInfo("CPU: '"CL_WHITE"%s [%d]"CL_RESET"'\n", sysinfo->cpu(), sysinfo->cpucores()); ShowInfo("Compiled with %s\n", sysinfo->compiler()); ShowInfo("Compile Flags: %s\n", sysinfo->cflags()); + ShowInfo("Timer Function Type: %s\n", sysinfo->time()); } /** diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 7cc4cd16a..95f423ff7 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -38,6 +38,7 @@ #ifdef WIN32 # include <windows.h> #else +# include <sys/time.h> // time constants # include <unistd.h> #endif @@ -1052,6 +1053,19 @@ void sysinfo_final(void) { sysinfo->p->vcstype_name = NULL; } +static const char *sysinfo_time(void) +{ +#if defined(WIN32) + return "ticks count"; +#elif defined(ENABLE_RDTSC) + return "rdtsc"; +#elif defined(HAVE_MONOTONIC_CLOCK) + return "monotonic clock"; +#else + return "time of day"; +#endif +} + /** * Interface default values initialization. */ @@ -1072,6 +1086,7 @@ void sysinfo_defaults(void) { sysinfo->is64bit = sysinfo_is64bit; sysinfo->compiler = sysinfo_compiler; sysinfo->cflags = sysinfo_cflags; + sysinfo->time = sysinfo_time; sysinfo->vcstype = sysinfo_vcstype; sysinfo->vcstypeid = sysinfo_vcstypeid; sysinfo->vcsrevision_src = sysinfo_vcsrevision_src; diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index 904be832f..2a391bfa4 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -52,6 +52,7 @@ struct sysinfo_interface { bool (*is64bit) (void); const char *(*compiler) (void); const char *(*cflags) (void); + const char *(*time) (void); const char *(*vcstype) (void); int (*vcstypeid) (void); const char *(*vcsrevision_src) (void); |