X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/a0f33b6682db1fc4ab60504f11e99eb682dc9c56..e7d099dcaa54dd959381402ff4500cacd7924984:/client/cmdhfmf.c diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index cf0f5c13..1d516ebc 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -30,7 +30,7 @@ int CmdHF14AMifare(const char *Cmd) printf("Press button on the proxmark3 device to abort both proxmark3 and client.\n"); printf("-------------------------------------------------------------------------\n"); - clock_t t = clock(); + clock_t t1 = clock(); start: clearCommandBuffer(); @@ -91,9 +91,10 @@ start: printf("------------------------------------------------------------------\n"); PrintAndLog("Found valid key: %012"llx" \n", r_key); } - t = clock() - t; - //printf("Time in darkside: %d ticks - %1.2f seconds\n", t, ((float)t)/CLOCKS_PER_SEC); - printf("Time in darkside: %Lf ticks - %1.2Lf seconds\n", (long double)t, ((long double)t)/CLOCKS_PER_SEC); + t1 = clock() - t1; + if ( t1 > 0 ){ + PrintAndLog("Time in darkside: %f ticks - %1.2f sec\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC); + } return 0; } @@ -312,8 +313,10 @@ int CmdHF14AMfDump(const char *Cmd) } // Read keys A from file + size_t bytes_read; for (sectorNo=0; sectorNo 0 ) { + PrintAndLog("Time in nested: %f ticks %1.2f sec (%1.2f sec per key)\n\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC, ((float)t1)/iterations/CLOCKS_PER_SEC); + } PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations); //print them @@ -1125,7 +1135,7 @@ int CmdHF14AMfChk(const char *Cmd) } } // time - clock_t time1 = clock(); + clock_t t1 = clock(); for ( int t = !keyType; t < 2; keyType==2?(t++):(t=2) ) { int b=blockNo; @@ -1148,8 +1158,10 @@ int CmdHF14AMfChk(const char *Cmd) b<127?(b+=4):(b+=16); } } - printf("Time in checkkeys: %1.3f (%1.3f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/keycnt/CLOCKS_PER_SEC); - + t1 = clock() - t1; + if ( t1 > 0 ){ + printf("Time in checkkeys: %f ticks %1.2f sec (%1.2f sec per key)\n\n", (float)t1, ((float)t1)/CLOCKS_PER_SEC, ((float)t1)/keycnt/CLOCKS_PER_SEC); + } if (transferToEml) { uint8_t block[16];