Changeset 14056 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include
- Timestamp:
- Nov 10, 2008 10:58:05 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h
r14046 r14056 33 33 #include <iprt/alloc.h> 34 34 35 #ifdef VBOX_GUI_DEBUG35 #ifdef DEBUG 36 36 37 37 #define AssertWrapperOk(w) \ … … 40 40 AssertMsg (w.isOk(), (#w ": " m " (RC=0x%08X)", w.lastRC())) 41 41 42 #else / / !VBOX_GUI_DEBUG42 #else /* #ifdef DEBUG */ 43 43 44 44 #define AssertWrapperOk(w) do {} while (0) 45 45 #define AssertWrapperOkMsg(w, m) do {} while (0) 46 46 47 #endif / / !VBOX_GUI_DEBUG47 #endif /* #ifdef DEBUG */ 48 48 49 49 #ifndef SIZEOF_ARRAY … … 62 62 #endif 63 63 #endif 64 65 /////////////////////////////////////////////////////////////////////////////66 67 #if defined (VBOX_GUI_DEBUG)68 69 #include <QThread>70 #include <QDateTime>71 72 #include <VBox/types.h> // for uint64_t type73 74 /**75 * A class to measure intervals using rdtsc instruction.76 */77 class VMCPUTimer : public QThread // for crossplatform msleep()78 {79 public:80 /* don't inline this function to not depend on iprt/asm.h here */81 static uint64_t ticks();82 inline static uint64_t msecs( uint64_t tcks ) {83 return tcks / ticks_per_msec;84 }85 inline static uint64_t msecsSince( uint64_t tcks ) {86 tcks = ticks() - tcks;87 return tcks / ticks_per_msec;88 }89 inline static void calibrate( int ms )90 {91 QTime t;92 uint64_t tcks = ticks();93 t.start();94 msleep( ms );95 tcks = ticks() - tcks;96 int msecs = t.elapsed();97 ticks_per_msec = tcks / msecs;98 }99 inline static uint64_t ticksPerMsec() {100 return ticks_per_msec;101 }102 private:103 static uint64_t ticks_per_msec;104 };105 106 #endif // VBOX_GUI_DEBUG107 64 108 65 /** Null UUID constant to be used as a default value for reference parameters */ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxFrameBuffer.h
r12449 r14056 46 46 47 47 class VBoxConsoleView; 48 49 //#define VBOX_GUI_FRAMEBUF_STAT50 51 #if defined (VBOX_GUI_DEBUG) && defined (VBOX_GUI_FRAMEBUF_STAT)52 #define FRAMEBUF_DEBUG_START(prefix) \53 uint64_t prefix##elapsed = VMCPUTimer::ticks();54 #define FRAMEBUF_DEBUG_STOP(prefix,w,h) { \55 prefix##elapsed = VMCPUTimer::ticks() - prefix##elapsed; \56 V_DEBUG(( "Last update: %04d x %04d px, %03.3f ms, %.0f ticks", \57 (w), (h), \58 (double) prefix##elapsed / (double) VMCPUTimer::ticksPerMsec(), \59 (double) prefix##elapsed \60 )); \61 }62 #else63 #define FRAMEBUF_DEBUG_START(prefix) {}64 #define FRAMEBUF_DEBUG_STOP(prefix,w,h) {}65 #endif66 48 67 49 /////////////////////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.