]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
Provide msclock() as Milliseconds timer for performance measures (#231)
[proxmark3-svn] / client / cmdhfmf.c
index eb3dc878f15adc79fcd3349d96ef00824b2e0916..b3f7acb2a1e1d0f12a16e2dd7341fdfc172e4d7e 100644 (file)
@@ -9,8 +9,10 @@
 //-----------------------------------------------------------------------------\r
 \r
 #include <inttypes.h>\r
+#include <string.h>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
+#include <ctype.h>\r
 #include "proxmark3.h"\r
 #include "cmdmain.h"\r
 #include "util.h"\r
@@ -688,8 +690,8 @@ int CmdHF14AMfNested(const char *Cmd)
                }\r
        }\r
        else { // ------------------------------------  multiple sectors working\r
-               clock_t time1;\r
-               time1 = clock();\r
+               uint64_t msclock1;\r
+               msclock1 = msclock();\r
 \r
                e_sector = calloc(SectorsCnt, sizeof(sector_t));\r
                if (e_sector == NULL) return 1;\r
@@ -759,7 +761,7 @@ int CmdHF14AMfNested(const char *Cmd)
                        }\r
                }\r
 \r
-               printf("Time in nested: %1.3f (%1.3f sec per key)\n\n", ((float)clock() - time1)/CLOCKS_PER_SEC, ((float)clock() - time1)/iterations/CLOCKS_PER_SEC);\r
+               printf("Time in nested: %1.3f (%1.3f sec per key)\n\n", ((float)(msclock() - msclock1))/1000.0, ((float)(msclock() - msclock1))/iterations/1000.0);\r
                \r
                PrintAndLog("-----------------------------------------------\nIterations count: %d\n\n", iterations);\r
                //print them\r
Impressum, Datenschutz