src/share/vm/runtime/timer.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7089790_full Sdiff src/share/vm/runtime

src/share/vm/runtime/timer.cpp

Print this page
rev 2694 : imported patch headers_only


  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "oops/oop.inline.hpp"
  27 #include "runtime/timer.hpp"
  28 #include "utilities/ostream.hpp"
  29 #ifdef TARGET_OS_FAMILY_linux
  30 # include "os_linux.inline.hpp"
  31 #endif
  32 #ifdef TARGET_OS_FAMILY_solaris
  33 # include "os_solaris.inline.hpp"
  34 #endif
  35 #ifdef TARGET_OS_FAMILY_windows
  36 # include "os_windows.inline.hpp"
  37 #endif



  38 
  39 
  40 void elapsedTimer::add(elapsedTimer t) {
  41   _counter += t._counter;
  42 }
  43 
  44 void elapsedTimer::start() {
  45   if (!_active) {
  46     _active = true;
  47     _start_counter = os::elapsed_counter();
  48   }
  49 }
  50 
  51 void elapsedTimer::stop() {
  52   if (_active) {
  53     _counter += os::elapsed_counter() - _start_counter;
  54     _active = false;
  55   }
  56 }
  57 




  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "oops/oop.inline.hpp"
  27 #include "runtime/timer.hpp"
  28 #include "utilities/ostream.hpp"
  29 #ifdef TARGET_OS_FAMILY_linux
  30 # include "os_linux.inline.hpp"
  31 #endif
  32 #ifdef TARGET_OS_FAMILY_solaris
  33 # include "os_solaris.inline.hpp"
  34 #endif
  35 #ifdef TARGET_OS_FAMILY_windows
  36 # include "os_windows.inline.hpp"
  37 #endif
  38 #ifdef TARGET_OS_FAMILY_bsd
  39 # include "os_bsd.inline.hpp"
  40 #endif
  41 
  42 
  43 void elapsedTimer::add(elapsedTimer t) {
  44   _counter += t._counter;
  45 }
  46 
  47 void elapsedTimer::start() {
  48   if (!_active) {
  49     _active = true;
  50     _start_counter = os::elapsed_counter();
  51   }
  52 }
  53 
  54 void elapsedTimer::stop() {
  55   if (_active) {
  56     _counter += os::elapsed_counter() - _start_counter;
  57     _active = false;
  58   }
  59 }
  60 


src/share/vm/runtime/timer.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File