[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [qtcurve] lib/utils: [lib/utils/timer] rename
From:       Yichao Yu <yyc1992 () gmail ! com>
Date:       2015-02-26 3:56:57
Message-ID: E1YQpZJ-0006MK-U3 () scm ! kde ! org
[Download RAW message or body]

Git commit 0671cbd9215993bd3c3bfab8afcf356c72486eaa by Yichao Yu.
Committed on 26/02/2015 at 03:54.
Pushed by yuyichao into branch 'master'.

[lib/utils/timer] rename

M  +7    -7    lib/utils/timer.cpp

http://commits.kde.org/qtcurve/0671cbd9215993bd3c3bfab8afcf356c72486eaa

diff --git a/lib/utils/timer.cpp b/lib/utils/timer.cpp
index 57ffd8b..ec2ffda 100644
--- a/lib/utils/timer.cpp
+++ b/lib/utils/timer.cpp
@@ -24,8 +24,6 @@
 #include <chrono>
 #include <vector>
 
-static thread_local std::vector<uint64_t> qtc_tics;
-
 namespace QtCurve {
 
 QTC_EXPORT uint64_t
@@ -42,11 +40,13 @@ getElapse(uint64_t prev)
     return getTime() - prev;
 }
 
+static thread_local std::vector<uint64_t> tics_list;
+
 QTC_EXPORT void
 tic()
 {
-    qtc_tics.push_back(0);
-    auto &back = qtc_tics.back();
+    tics_list.push_back(0);
+    auto &back = tics_list.back();
     back = getTime();
 }
 
@@ -54,11 +54,11 @@ QTC_EXPORT uint64_t
 toc()
 {
     uint64_t cur_time = getTime();
-    if (!qtc_tics.size()) {
+    if (!tics_list.size()) {
         return 0;
     }
-    uint64_t old_time = qtc_tics.back();
-    qtc_tics.pop_back();
+    uint64_t old_time = tics_list.back();
+    tics_list.pop_back();
     return cur_time - old_time;
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic