From 03b33425e5a3de3fad070aa21e7fc7baf8104c81 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 19 May 2011 19:05:35 +0200 Subject: many changes to my_getsystime.c: * my_getsystime() is only an interval timer. Its value can beused for calculating time intervals. * renamed my_getsystime() to my_interval_timer(), to make the semantics clearer and let the compiler catch wrong usages of my_getsystime() (also future ones, that may come in merges). * increased its granularity from 100ns to 1ns, old value was for UUID, but as UUID can no longer use it directly there is no need to downgrade the OS provided value * fixed the UUID code to anchor the my_interval_timer() on the epoch, as required by the UUID standard. That is, this was only needed by UUID, and now I've moved it to UUID code from my_getsystime(). * fixed other wrong usages of my_getsystime() - e.g. in calculating times for pthread_cond_timedwait. It was buggy and could've caused long waits if OS clock would be changed. --- sql/sql_profile.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_profile.cc') diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index c661f3744aa..732e7431efc 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -221,7 +221,7 @@ void PROF_MEASUREMENT::set_label(const char *status_arg, */ void PROF_MEASUREMENT::collect() { - time_usecs= (double) my_getsystime() / 10.0; /* 1 sec was 1e7, now is 1e6 */ + time_usecs= my_interval_timer() / 1e3; /* ns to us */ #ifdef HAVE_GETRUSAGE getrusage(RUSAGE_SELF, &rusage); #endif -- cgit v1.2.1