gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libbase/tu_timer.cpp libbase/tu...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog libbase/tu_timer.cpp libbase/tu...
Date: Fri, 04 Apr 2008 11:43:13 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/04/04 11:43:13

Modified files:
        .              : ChangeLog 
        libbase        : tu_timer.cpp tu_timer.h 

Log message:
                * libbase/tu_timer.{h,cpp}: drop unnecessary functions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6178&r2=1.6179
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/tu_timer.cpp?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/tu_timer.h?cvsroot=gnash&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6178
retrieving revision 1.6179
diff -u -b -r1.6178 -r1.6179
--- ChangeLog   4 Apr 2008 10:51:53 -0000       1.6178
+++ ChangeLog   4 Apr 2008 11:43:12 -0000       1.6179
@@ -1,3 +1,7 @@
+2008-04-04 Benjamin Wolsey <address@hidden>
+
+       * libbase/tu_timer.{h,cpp}: drop unnecessary functions.
+
 2008-04-04 Sandro Santilli <address@hidden>
 
        * server/character.{cpp,h}: have getMovieInfo return an iterator

Index: libbase/tu_timer.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/tu_timer.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- libbase/tu_timer.cpp        4 Dec 2007 11:45:24 -0000       1.15
+++ libbase/tu_timer.cpp        4 Apr 2008 11:43:13 -0000       1.16
@@ -26,31 +26,6 @@
        return ticks * (1.0f / 1000.f);
 }
 
-
-boost::uint64_t        tu_timer::get_profile_ticks()
-{
-       // @@ use rdtsc?
-
-       //Nano-second timer.
-       LARGE_INTEGER   li;
-       QueryPerformanceCounter(&li);
-
-       return li.QuadPart;
-}
-
-
-double tu_timer::profile_ticks_to_seconds(boost::uint64_t ticks)
-{
-       LARGE_INTEGER   freq;
-       QueryPerformanceFrequency(&freq);
-
-       double  seconds = (double) ticks;
-       seconds /= (double) freq.QuadPart;
-
-       return seconds;
-}
-
-
 #else  // not _WIN32
 
 
@@ -62,37 +37,22 @@
 
 boost::uint64_t tu_timer::get_ticks()
 {
-       return static_cast<boost::uint64_t>(get_profile_ticks()/1000.0);
-}
-
 
-double tu_timer::ticks_to_seconds(boost::uint64_t ticks)
-{
-       return profile_ticks_to_seconds(ticks);
-}
-
-
-boost::uint64_t        tu_timer::get_profile_ticks()
-{
-       // @@ TODO prefer rdtsc when available?
-
-       // Return microseconds.
        struct timeval tv;
        
        gettimeofday(&tv, 0);
 
-       boost::uint64_t result = (boost::uint64_t)tv.tv_sec * 1000000L;
+       boost::uint64_t result = static_cast<boost::uint64_t>(tv.tv_sec) * 
1000000L;
 
        result += tv.tv_usec;
        // Time Unit: microsecond
 
-       return result;
+       return static_cast<boost::uint64_t>(result / 1000.0);
 }
 
 
-double tu_timer::profile_ticks_to_seconds(boost::uint64_t ticks)
+double tu_timer::ticks_to_seconds(boost::uint64_t ticks)
 {
-       // ticks is microseconds.  Convert to seconds.
        return ticks / 1000000.0;
 }
 

Index: libbase/tu_timer.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/tu_timer.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- libbase/tu_timer.h  27 Mar 2008 16:12:36 -0000      1.10
+++ libbase/tu_timer.h  4 Apr 2008 11:43:13 -0000       1.11
@@ -22,17 +22,6 @@
        // Time Unit: second
        DSOEXPORT double ticks_to_seconds(boost::uint64_t ticks);
        
-       // Hi-res timer for CPU profiling.
-
-       // Return a hi-res timer value.  Time 0 is arbitrary, so
-       // generally you want to call this at the start and end of an
-       // operation, and pass the difference to
-       // profile_ticks_to_seconds() to find out how long the
-       // operation took.
-       DSOEXPORT boost::uint64_t       get_profile_ticks();
-
-       // Convert a hi-res ticks value into seconds.
-       DSOEXPORT double        profile_ticks_to_seconds(boost::uint64_t 
profile_ticks);
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]