if(state.DSMRECOVERYSTATS) {
outmethod.println("#ifdef RECOVERYSTATS\n");
outmethod.println("printf(\"***** Recovery Stats *****\\n\");");
- outmethod.println("printf(\"numRecovery = %d\\n\",numRecovery)");
+ outmethod.println("printf(\"numRecovery = %d\\n\",numRecovery);");
outmethod.println("int nRecovery=0;");
outmethod.println("for(nRecovery=0;nRecovery<numRecovery;nRecovery++) {");
- outmethod.println(" printf(\"Dead Machine = %s\\n\",deadMachine[nRecovery]);");
+ outmethod.println(" printf(\"Dead Machine = %s\\n\",midtoIPString(deadMachine[nRecovery]));");
outmethod.println(" printf(\"Recovery Time = %.2f\\n\",elapsedTime[nRecovery]);");
- outmethod.println(" }\n");
- outmethod.println("fflush(stdout);");
+ outmethod.println("}\n");
outmethod.println("#endif\n");
}
#ifdef RECOVERYSTATS
printf("Recovery Start\n");
numRecovery++;
- time_t st = time(NULL);
+ time_t st;
time_t fi;
+ time(&st);
deadMachine[numRecovery-1] = mid;
#endif
}
#ifdef RECOVERYSTATS
- fi = time(NULL);
- elapsedTime[numRecovery-1] = fi-st;
+ time(&fi);
+ elapsedTime[numRecovery-1] = difftime(fi,st);
#endif
#ifndef DEBUG