MESSAGE(pthread_self().p << "Send BeginService notification for " <<serviceName
<< endl << "Component instance : " << _instanceName << endl << endl);
#endif
+ std::cerr << "beginService for " << serviceName << " Component instance : " << _instanceName << std::endl;
#ifndef WIN32
_ThreadId = pthread_self() ;
#else
if ( !_CanceledThread )
_ThreadCpuUsed = CpuUsed_impl() ;
+ float cpus=_ThreadCpuUsed/1000.;
+ std::cerr << "endService for " << serviceName << " Component instance : " << _instanceName ;
+ std::cerr << " Cpu Used: " << cpus << " (s) " << std::endl;
#ifndef WIN32
MESSAGE(pthread_self() << " Send EndService notification for " << serviceName
<< endl << " Component instance : " << _instanceName << " StartUsed "
perror("Engines_Component_i::CpuUsed") ;
return 0 ;
}
- cpu = usage.ru_utime.tv_sec - _StartUsed ;
+ //cpu time is calculated in millisecond (user+system times)
+ cpu = usage.ru_utime.tv_sec*1000 +usage.ru_utime.tv_usec/1000;
+ cpu = cpu+ usage.ru_stime.tv_sec*1000 +usage.ru_stime.tv_usec/1000;
+ cpu=cpu-_StartUsed ;
// cout << pthread_self() << " Engines_Component_i::CpuUsed " << " "
// << _serviceName << usage.ru_utime.tv_sec << " - " << _StartUsed
// << " = " << cpu << endl ;
public :
SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 );
SALOME_Exception( const SALOME_Exception &ex );
- ~SALOME_Exception() throw ();
+ virtual ~SALOME_Exception() throw ();
friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
virtual const char *what( void ) const throw () ;
} ;