Janilabo

CTS failsafe timing

Mar 29th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.78 KB | None | 0 0
  1. {$I MSSL\MSSL.scar}
  2.  
  3. procedure ScriptTerminate;
  4. begin
  5.   MSSL_Unsetup;
  6. end;
  7.  
  8. var
  9.   x, t, l: Integer;
  10.  
  11. procedure a;
  12. var
  13.   CTS: Boolean;
  14.   cs: MSSL_TColorSettings;
  15. begin
  16.   Inc(l);
  17.   CTS := (GetColorToleranceSpeed <> 1)
  18.   if CTS then
  19.   begin
  20.     cs := MSSL_GetColorSettings;
  21.     ColorToleranceSpeed(1);
  22.   end;                    
  23.   if CTS then
  24.     MSSL_SetColorSettings(cs);
  25. end;
  26.  
  27. procedure b;
  28. var
  29.   CTS: Boolean;
  30.   cs: MSSL_TColorSettings;
  31. begin
  32.   Inc(l);
  33.   CTS := (GetColorToleranceSpeed <> 1)
  34.   if CTS then
  35.   begin
  36.     cs := MSSL_GetColorSettings;
  37.     ColorToleranceSpeed(1);
  38.   end;                  
  39.   a;  
  40.   if CTS then
  41.     MSSL_SetColorSettings(cs);
  42. end;
  43.  
  44. procedure c;
  45. var
  46.   CTS: Boolean;
  47.   cs: MSSL_TColorSettings;
  48. begin
  49.   Inc(l);
  50.   CTS := (GetColorToleranceSpeed <> 1)
  51.   if CTS then
  52.   begin
  53.     cs := MSSL_GetColorSettings;
  54.     ColorToleranceSpeed(1);
  55.   end;
  56.   a;
  57.   b;                  
  58.   if CTS then
  59.     MSSL_SetColorSettings(cs);
  60. end;
  61.  
  62. procedure d;
  63. var
  64.   CTS: Boolean;
  65.   cs: MSSL_TColorSettings;
  66. begin
  67.   Inc(l);
  68.   CTS := (GetColorToleranceSpeed <> 1)
  69.   if CTS then
  70.   begin
  71.     cs := MSSL_GetColorSettings;
  72.     ColorToleranceSpeed(1);
  73.   end;  
  74.   a;
  75.   b;  
  76.   c;              
  77.   if CTS then
  78.     MSSL_SetColorSettings(cs);
  79. end;
  80.  
  81. procedure e;
  82. var
  83.   CTS: Boolean;
  84.   cs: MSSL_TColorSettings;
  85. begin
  86.   Inc(l);
  87.   CTS := (GetColorToleranceSpeed <> 1)
  88.   if CTS then
  89.   begin
  90.     cs := MSSL_GetColorSettings;
  91.     ColorToleranceSpeed(1);
  92.   end;
  93.   a;
  94.   b;
  95.   c;    
  96.   d;              
  97.   if CTS then
  98.     MSSL_SetColorSettings(cs);
  99. end;
  100.  
  101. procedure f;
  102. var
  103.   CTS: Boolean;
  104.   cs: MSSL_TColorSettings;
  105. begin
  106.   Inc(l);
  107.   CTS := (GetColorToleranceSpeed <> 1)
  108.   if CTS then
  109.   begin
  110.     cs := MSSL_GetColorSettings;
  111.     ColorToleranceSpeed(1);
  112.   end;  
  113.   a;
  114.   b;
  115.   c;
  116.   d;  
  117.   e;              
  118.   if CTS then
  119.     MSSL_SetColorSettings(cs);
  120. end;
  121.    
  122. procedure g;
  123. var
  124.   CTS: Boolean;
  125.   cs: MSSL_TColorSettings;
  126. begin
  127.   Inc(l);
  128.   CTS := (GetColorToleranceSpeed <> 1)
  129.   if CTS then
  130.   begin
  131.     cs := MSSL_GetColorSettings;
  132.     ColorToleranceSpeed(1);
  133.   end;
  134.   a;
  135.   b;
  136.   c;
  137.   d;
  138.   e;    
  139.   f;              
  140.   if CTS then
  141.     MSSL_SetColorSettings(cs);
  142. end;
  143.  
  144. procedure h;
  145. begin
  146.   Inc(l);
  147.   ColorToleranceSpeed(2);
  148.   SetColorspeed2Modifiers(0.43, 1.38);  
  149.   a;
  150.   b;
  151.   c;
  152.   d;
  153.   e;
  154.   f;
  155.   g;
  156.   ColorToleranceSpeed(1);              
  157. end;
  158.  
  159. begin
  160.   MSSL_Setup;
  161.   repeat      
  162.     l := 0;
  163.     t := GetSystemTime;
  164.     for x := 0 to 9 do
  165.     begin
  166.       a;
  167.       b;
  168.       c;
  169.       d;
  170.       e;
  171.       f;
  172.       g;
  173.       h;      
  174.     end;
  175.     Status(MSSL_TheTime + ' ran ' + IntToStr(l) + ' lookups [' + IntToStr(GetSystemTime - t) + ' ms.]');      
  176.     MSSL_Wait(0);
  177.   until False;
  178. end.
Advertisement
Add Comment
Please, Sign In to add comment