fork download
  1. uses SysUtils, DateUtils;
  2. const
  3. COUNT = 10000000;
  4. var
  5. st, en : TDateTime;
  6. pr, i, j : LongInt;
  7. begin
  8. st := Now;
  9.  
  10. for j := 1 to COUNT do begin
  11. pr := 1;
  12. for i := 15 to 25 do
  13. pr := pr * 2*i;
  14. end;
  15.  
  16. en := Now;
  17. WriteLn('for : ', MilliSecondsBetween(st, en));
  18.  
  19. st := Now;
  20. for j := 1 to COUNT do begin
  21. pr := 1;
  22. i := 30;
  23. while i <= 50 do begin
  24. pr := pr*i;
  25. Inc(i, 2)
  26. end
  27. end;
  28. en := Now;
  29. WriteLn('while : ', MilliSecondsBetween(st, en))
  30.  
  31. end.
Success #stdin #stdout 1.01s 420KB
stdin
Standard input is empty
stdout
for : 455
while : 553