Changeset f9bb68 in git for kernel/timer.cc
- Timestamp:
- Aug 27, 2010, 10:15:09 AM (14 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 555b030713519677d5c1d72e1cdfacc419cc4bdc
- Parents:
- 5cb9ecd7f9c68100731d2b46abd492589627c598
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/timer.cc
r5cb9ec rf9bb68 176 176 extern int iiOp; 177 177 #endif 178 179 char* dateTime() 180 { 181 #ifdef GETRUSAGE 182 time_t rawtime; 183 time(&rawtime); 184 char* s = ctime(&rawtime); // s: with linefeed at the end 185 int l = strlen(s); 186 char* ss = (char*)omAlloc(l); 187 strncpy(ss, s, l - 1); 188 ss[l - 1] = '\0'; // ss: without linefeed at the end 189 return ss; 190 #else 191 char* s = "Warning: date/time not available on your system"; 192 int l = strlen(s) + 1; 193 char* ss = (char*)omAlloc(l); 194 strncpy(ss, s, l - 1); 195 ss[l - 1] = '\0'; 196 return ss; 197 #endif 198 } 199 178 200 void writeTime(const char* v) 179 201 {
Note: See TracChangeset
for help on using the changeset viewer.