Here is my class wich is a quick and easy way to do contest:



An Example:
vb Code:
  1. Option Explicit
  2.  
  3. Private C As New cFrogContest
  4.  
  5. Function VerySlow(a As Long, b As Long) As Double
  6.     VerySlow = 2
  7.     Dim x As Long
  8.     For x = 0 To 15
  9.         DoEvents
  10.     Next
  11. End Function
  12.  
  13. Function Slow(a As Long, b As Long) As Double
  14.     Slow = 2
  15.     Dim x As Long
  16.     For x = 0 To 10
  17.         DoEvents
  18.     Next
  19. End Function
  20.  
  21. Function Quick(a As Long, b As Long) As Long
  22.     Quick = 2
  23.     Dim x As Long
  24.     For x = 0 To 5
  25.         DoEvents
  26.     Next
  27. End Function
  28.  
  29. Function VeryQuick(a As Long, b As Long) As Long
  30.     VeryQuick = 3
  31. End Function
  32.  
  33. Private Sub Form_Load()
  34.     With C
  35.         .ContestName = "Test1"
  36.         .SaveDirectory = "c:\"
  37.         .Explanation = "It's only test"
  38.         .Arguments 20, 300
  39.         .Functions "VerySlow,VeryQuick,Slow,Quick"
  40.         .ReplaceFile = True
  41.         .Result = 2
  42.         .NumberOfLoops = 100
  43.         .TestIt
  44.         .ShowTest
  45.     End With
  46. End Sub
  47.  
  48. Private Sub Form_Click()
  49.     Unload Me
  50. End Sub
  51.  
  52. Private Sub Form_Unload(Cancel As Integer)
  53.     Set C = Nothing
  54. End Sub

Returns:
Code:
================================================================================
º Contest Name : Test
º Arguments    : 20, 300
º Explanation  : -
&#186; Date         : 02-06-2011 <-> 16:58:44
================================================================================
Results [not compiled] :
--------------------------------------------------------------------------------
1.- VeryQuick ------>       0,6934159      msec
2.- Quick     ------>       2,6165497      msec
3.- Slow      ------>       7,1359347      msec
4.- VerySlow  ------>       7,9149945      msec
================================================================================
&#186; The following functions return incorrect results :
--------------------------------------------------------------------------------
1.- VeryQuick
================================================================================
>>> Test made by cFrogContest.cls <-> Visit foro.elhacker.net <<<
================================================================================
I hope you like it, and i would appreciate coment to improve it, or any tip to learn something for the next time.
Specially my way to compare if it returns correct results
See you!