+2005-06-08 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmUtil.cxx : change call to Util::Format to sprintf because of
+ lantency with the Util::Format function
+
2005-06-07 Mathieu Malaterre <Mathieu.Malaterre@creatis.insa-lyon.fr>
* Adding users file in CVSROOT for mail blaming
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2005/06/07 13:48:35 $
- Version: $Revision: 1.153 $
+ Date: $Date: 2005/06/08 12:24:53 $
+ Version: $Revision: 1.154 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
strftime (tmp, sizeof (tmp), "%Y%m%d%H%M%S", ptm);
// Add milliseconds
- std::string r = tmp;
- r += Format("%03ld", milliseconds);
+ // Don't use Util::Format to accelerate execution of code
+ char tmpAll[80];
+ sprintf(tmpAll,"%s%03ld",tmp,milliseconds);
- return r;
+ return tmpAll;
}
unsigned int Util::GetCurrentThreadID()
append += Util::GetCurrentDateTime();
//Also add a mini random number just in case:
+ char tmp[10];
int r = (int) (100.0*rand()/RAND_MAX);
- append += Format("%02d", r);
+ // Don't use Util::Format to accelerate the execution
+ sprintf(tmp,"%02d", r);
+ append += tmp;
// If append is too long we need to rehash it
if( (prefix + append).size() > 64 )