Guest User

Untitled

a guest
Jul 26th, 2012
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.78 KB | None | 0 0
  1. #include <a_samp>
  2. #include <mfiles>
  3.  
  4. main() {}
  5.  
  6. public OnGameModeInit() {
  7.     new file[] = "mFiles_test.ini", _str[20];
  8.     if(!File_Exists(file)) File_Create(file);
  9.     new initialTick, finalTick;
  10.     initialTick = GetTickCount();
  11.     File_Write(file);
  12.     for(new i; i < 100; ++i) {
  13.         format(_str, sizeof(_str), "String%d", i);
  14.         File_WriteString(_str, "mFiles speed tests, this is the official test!");
  15.     }
  16.     File_WriteFinish(file);
  17.     finalTick = GetTickCount();
  18.     printf("writing: %d (ms)", finalTick-initialTick);
  19.     new string[100];
  20.     initialTick = GetTickCount();
  21.     File_Open(file);
  22.     for(new i; i < 100; ++i) {
  23.         format(_str, sizeof(_str), "String%d", i);
  24.         File_GetStringEx(_str, string);
  25.     }
  26.     finalTick = GetTickCount();
  27.     printf("reading: %d (ms)", finalTick-initialTick);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment