Advertisement
Guest User

Double-O-Seven

a guest
Sep 13th, 2010
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.94 KB | None | 0 0
  1. #include <Double-O-Files>
  2. #include <Dini>
  3. #include <djson>
  4.  
  5. #define MAX 100
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     djson_GameModeInit();
  10.     new k;
  11.     while(k<50)
  12.     {
  13.         printf("\nFileID=%d (%d Eintraege)",k,MAX);
  14.         new t,file[64],string[64];
  15.         t=GetTickCount();
  16.         format(file,sizeof(file),"DOFfile%03d.txt",k);
  17.         DOF_CreateFile(file);
  18.         for(new i=0;i<MAX;i++)
  19.         {
  20.             format(string,sizeof(string),"IntVal%02d",i);
  21.             DOF_SetInt(file,string,random(1000));
  22.         }
  23.         printf("DOF SET: t=%d",GetTickCount()-t);
  24.        
  25.         t=GetTickCount();
  26.         format(file,sizeof(file),"DINIfile%03d.txt",k);
  27.         dini_Create(file);
  28.         for(new i=0;i<MAX;i++)
  29.         {
  30.             format(string,sizeof(string),"IntVal%02d",i);
  31.             dini_IntSet(file,string,random(1000));
  32.         }
  33.         printf("DINI SET: t=%d",GetTickCount()-t);
  34.        
  35.         t=GetTickCount();
  36.         format(file,sizeof(file),"DJSONfile%03d.txt",k);
  37.         djCreateFile(file);
  38.         djAutocommit(false);
  39.         for(new i=0;i<MAX;i++)
  40.         {
  41.             format(string,sizeof(string),"Test/IntVal%02d",i);
  42.             djSetInt(file,string,random(1000));
  43.         }
  44.         djCommit(file);
  45.         djAutocommit(true);
  46.         printf("DJSON SET: t=%d",GetTickCount()-t);
  47.        
  48.         t=GetTickCount();
  49.         format(file,sizeof(file),"DOFfile%03d.txt",k);
  50.         for(new i=0;i<MAX;i++)
  51.         {
  52.             format(string,sizeof(string),"IntVal%02d",i);
  53.             DOF_GetInt(file,string);
  54.         }
  55.         printf("DOF GET: t=%d",GetTickCount()-t);
  56.  
  57.         t=GetTickCount();
  58.         format(file,sizeof(file),"DINIfile%03d.txt",k);
  59.         for(new i=0;i<MAX;i++)
  60.         {
  61.             format(string,sizeof(string),"IntVal%02d",i);
  62.             dini_Int(file,string);
  63.         }
  64.         printf("DINI GET: t=%d",GetTickCount()-t);
  65.        
  66.         t=GetTickCount();
  67.         format(file,sizeof(file),"DJSONfile%03d.txt",k);
  68.         for(new i=0;i<MAX;i++)
  69.         {
  70.             format(string,sizeof(string),"Test/IntVal%02d",i);
  71.             djInt(file,string);
  72.         }
  73.         printf("DJSON GET: t=%d",GetTickCount()-t);
  74.         k++;
  75.     }
  76.     return 1;
  77. }
  78.  
  79. public OnFilterScriptExit()
  80. {
  81.     DOF_Exit();
  82.     djson_GameModeExit();
  83.     return 1;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement