Advertisement
headlinedev

Untitled

Jun 25th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. #include <SMObjects>
  2. #include <profiler>
  3.  
  4. Handle profiler;
  5.  
  6. Object objects[10000];
  7.  
  8. public void OnPluginStart()
  9. {
  10.     profiler = CreateProfiler();
  11.     StartProfiling(profiler);
  12.        
  13.     // Initialize
  14.     for(int i = 0; i < sizeof(objects); i++)
  15.     {
  16.         objects[i] = new Object();
  17.     }
  18.    
  19.     // Write
  20.     for(int i = 0; i < sizeof(objects); i++)
  21.     {
  22.         objects[i].SetInt("testint", i);
  23.     }
  24.    
  25.     // Read
  26.     int test;
  27.     for(int i = 0; i < sizeof(objects); i++)
  28.     {
  29.         test = objects[i].GetInt("testint");
  30.     }
  31.    
  32.     if (test){} // silence "symbol is assigned a value that is never used: "test""
  33.    
  34.     for(int i = 0; i < sizeof(objects); i++)
  35.     {
  36.         delete objects[i];
  37.     }
  38.    
  39.     StopProfiling(profiler);
  40.     float time = GetProfilerTime(profiler);
  41.     PrintToServer("Operation took %f seconds", time);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement