Changeset 3638 in Sophya


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

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

Location:
trunk/SophyaLib/SysTools
Files:
2 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();
  • trunk/SophyaLib/SysTools/ctimer.h

    r3636 r3638  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: ctimer.h,v 1.7 2009-05-26 20:24:24 ansari Exp $
     3// $Id: ctimer.h,v 1.8 2009-05-26 21:39:55 ansari Exp $
    44//
    55
     
    2727class Timer  {
    2828public:
     29  Timer(bool prfg=true);
    2930  // L'objet memorise le temps CPU et l'heure, et le nom donne
    30   Timer(const char* name=0, bool prfg=true);
     31  Timer(const char* name, bool prfg=true);
    3132
    3233  // Le destructeur appelle split sans parametre.
Note: See TracChangeset for help on using the changeset viewer.