/[svn]/linuxsampler/trunk/src/engines/gig/Profiler.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Profiler.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 327 by senkov, Tue Dec 21 04:59:11 2004 UTC revision 328 by schoenebeck, Sat Dec 25 21:58:58 2004 UTC
# Line 22  Line 22 
22    
23  #ifndef __LS_GIG_PROFILER_H__  #ifndef __LS_GIG_PROFILER_H__
24  #define __LS_GIG_PROFILER_H__  #define __LS_GIG_PROFILER_H__
25    
26  #include <stdio.h>  #include <stdio.h>
27    
28    #include "../../common/global.h"
29    #include "../../common/RTMath.h"
30    
31  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
32    
33      class Profiler {      class Profiler {
# Line 36  namespace LinuxSampler { namespace gig { Line 40  namespace LinuxSampler { namespace gig {
40    
41              static unsigned int GetBogoVoices( unsigned int SamplingFreq );              static unsigned int GetBogoVoices( unsigned int SamplingFreq );
42    
43              static unsigned long long Stamp( void )              static RTMath::time_stamp_t Stamp( void )
44              {              {
45                      unsigned long long temp;                      return RTMath::CreateTimeStamp();
                     __asm__ __volatile__ ("rdtsc" : "=A" (temp));  
                     return temp;  
46              }              }
47    
48              static void Record( unsigned long long start,              static void Record( RTMath::time_stamp_t start,
49                          unsigned int samples, unsigned int skip )                          unsigned int samples, unsigned int skip )
50              {              {
51                      unsigned long long stop = Stamp();                      RTMath::time_stamp_t stop = Stamp();
52                      profilingTime += (stop - start);                      profilingTime += (stop - start);
53                      profilingSamples += (samples - skip);                      profilingSamples += (samples - skip);
54              }              }
# Line 56  namespace LinuxSampler { namespace gig { Line 58  namespace LinuxSampler { namespace gig {
58          private:          private:
59              static unsigned long long profilingSamples;              static unsigned long long profilingSamples;
60              static unsigned long long profilingTime;              static unsigned long long profilingTime;
61              static unsigned long long ticksPerSecond;              static double tsPerSecond;
62      };      };
63    
64  }} // namespace LinuxSampler::gig  }} // namespace LinuxSampler::gig

Legend:
Removed from v.327  
changed lines
  Added in v.328

  ViewVC Help
Powered by ViewVC