Changeset 3638 in Sophya for trunk/SophyaLib/SysTools/ctimer.cc


Ignore:
Timestamp:
May 26, 2009, 11:39:55 PM (16 years ago)
Author:
ansari
Message:

Correction bug plantage Timer(NULL) - Reza 26/05/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/ctimer.cc

    r3636 r3638  
    11//
    2 // $Id: ctimer.cc,v 1.9 2009-05-26 20:24:23 ansari Exp $
     2// $Id: ctimer.cc,v 1.10 2009-05-26 21:39:54 ansari Exp $
    33//
    44
     
    4646
    4747namespace SOPHYA {
     48//! Default constructor with optional default print flag
     49Timer::Timer(bool prfg)
     50  : defprtflg(prfg)
     51{
     52  cpu0 = cpuSplit = clock();
     53  gettimeofday(&elapse0, NULL);
     54  elapseSplit = elapse0;
     55//  elapse0 = elapseSplit = time(0);
     56  cpuSecT = cpuSecP = 0.;
     57  elapSecT = elapSecP = 0;
     58}
    4859/*!
    49   \brief Constructor with the specification of a optional name or message
    50   and default print flag.
     60  \brief Constructor with the specification of a name or message
     61  and optional default print flag.
    5162  if \b prfg==true , a call to Split() causes the display of partial and
    5263  total CPU and elapsed time.
    5364*/
    5465Timer::Timer(const char* name, bool prfg)
    55   : timerName(name) , defprtflg(prfg)
     66  : timerName(((name!=NULL)?name:"")) , defprtflg(prfg)
    5667{
    5768  cpu0 = cpuSplit = clock();
Note: See TracChangeset for help on using the changeset viewer.