diff options
author | Haru <haru@dotalux.com> | 2016-02-06 17:28:35 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-02-06 17:28:35 +0100 |
commit | 4a6f28cce495b118840da5139e7dd315437ee4b0 (patch) | |
tree | beb65c47370d666ac34e02d121ab99494ee66335 /src/common/sysinfo.c | |
parent | 9d4ce2dc78fc0c7043948252ddb3ac45875df70a (diff) | |
parent | 8b59df7b9b89ff897d1259130da5d393d815be82 (diff) | |
download | hercules-4a6f28cce495b118840da5139e7dd315437ee4b0.tar.gz hercules-4a6f28cce495b118840da5139e7dd315437ee4b0.tar.bz2 hercules-4a6f28cce495b118840da5139e7dd315437ee4b0.tar.xz hercules-4a6f28cce495b118840da5139e7dd315437ee4b0.zip |
Merge pull request #1131 from 4144/timers
Add to system information also information about clock function.
Diffstat (limited to 'src/common/sysinfo.c')
-rw-r--r-- | src/common/sysinfo.c | 15 |
1 files changed, 15 insertions, 0 deletions
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; |