00001 // @(#)root/base:$Id: TTime.cxx 34556 2010-07-22 15:10:17Z rdm $ 00002 // Author: Fons Rademakers 28/11/96 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 ////////////////////////////////////////////////////////////////////////// 00013 // // 00014 // TTime // 00015 // // 00016 // Basic time type with millisecond precision. // 00017 // // 00018 ////////////////////////////////////////////////////////////////////////// 00019 00020 #include "TTime.h" 00021 #include "TString.h" 00022 #include "TError.h" 00023 00024 00025 ClassImp(TTime) 00026 00027 //______________________________________________________________________________ 00028 const char *TTime::AsString() const 00029 { 00030 // Return the time as a string. 00031 00032 return Form("%lld", fMilliSec); 00033 } 00034 00035 //______________________________________________________________________________ 00036 TTime::operator long() const 00037 { 00038 #ifndef R__B64 00039 if (fMilliSec > (Long64_t)kMaxInt) 00040 Error("TTime::operator long()", "time truncated, use operator long long"); 00041 #endif 00042 return (Long_t) fMilliSec; 00043 } 00044 00045 //______________________________________________________________________________ 00046 TTime::operator unsigned long() const 00047 { 00048 #ifndef R__B64 00049 if (fMilliSec > (Long64_t)kMaxUInt) 00050 Error("TTime::operator unsigned long()", "time truncated, use operator unsigned long long"); 00051 #endif 00052 return (ULong_t) fMilliSec; 00053 }