Panda3D
 All Classes Functions Variables Enumerations
pStatTimer.I
00001 // Filename: pStatTimer.I
00002 // Created by:  drose (11Jul00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 #ifdef DO_PSTATS
00017 
00018 ////////////////////////////////////////////////////////////////////
00019 //     Function: PStatTimer::Constructor
00020 //       Access: Public
00021 //  Description:
00022 ////////////////////////////////////////////////////////////////////
00023 INLINE PStatTimer::
00024 PStatTimer(PStatCollector &collector) :
00025   _collector(collector),
00026   _thread(PStatClient::get_global_pstats()->get_current_thread())
00027 {
00028   _collector.start(_thread);
00029 }
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //     Function: PStatTimer::Constructor
00033 //       Access: Public
00034 //  Description:
00035 ////////////////////////////////////////////////////////////////////
00036 INLINE PStatTimer::
00037 PStatTimer(PStatCollector &collector, Thread *current_thread) :
00038   _collector(collector),
00039   _thread(current_thread)
00040 {
00041   _collector.start(_thread);
00042 }
00043 
00044 ////////////////////////////////////////////////////////////////////
00045 //     Function: PStatTimer::Destructor
00046 //       Access: Public
00047 //  Description:
00048 ////////////////////////////////////////////////////////////////////
00049 INLINE PStatTimer::
00050 ~PStatTimer() {
00051   _collector.stop(_thread);
00052 }
00053 
00054 #endif
 All Classes Functions Variables Enumerations