29.01.2011, 14:35
My result:
Test script:
Test script:
Код:
#include <a_samp> #include <dfile> #include <Fini> #define TESZT 500 public OnFilterScriptInit() { new string[128]; dfile_Create("Dfile.txt"); dfile_Create("scriptfiles/Fini.txt"); new Dfile = GetTickCount(); dfile_Open("Dfile.txt"); print("\n\n\n"); print("Writing data:"); print("----------------------------"); for(new i; i < TESZT; i++) { format(string, sizeof(string), "teszt%d", i); dfile_WriteString(string, "test"); } dfile_SaveFile(); printf("[DFILE] writing time: %d", GetTickCount() - Dfile); new Fini = GetTickCount(); Fini_OpenFile("Fini.txt"); for(new i; i < TESZT; i++) { format(string, sizeof(string), "test%d", i); Fini_SetStr(string, "test"); } Fini_SaveFile(); Fini_CloseFile(); printf("[FINI] writing time: %d", GetTickCount() - Fini); printf("\n\n\n"); print("Reading data:"); print("----------------------------"); Dfile = GetTickCount(); dfile_Open("Dfile.txt"); new dfilevalue, finivalue; while(GetTickCount() - Dfile < 1000) { dfile_ReadString("teszt1"); dfilevalue++; } dfile_CloseFile(); printf("[DFILE] reading time: %d", dfilevalue); Fini = GetTickCount(); Fini_OpenFile("Fini.txt"); while(GetTickCount() - Fini < 1000) { Fini_GetStr("test1"); finivalue++; } Fini_CloseFile(); printf("[FINI] readingtime: %d", finivalue); return true; }