К сожалению я не знаток программирования. Если Вы хотите действительно помочь, то помогите составить в паскале решето эратосфена (к примеру) (в википедии я видел уже готовое решение) с уже вставленным обращением к системному таймеру, а я уж на основе попробую (с вашими советами, если сможете) вставить по аналогу в этот алгоритм. Вот и будут все данные о скорости на языке цифр.
Вот вам примитивная реализация решета Эратосфена:
Код:
Program primes;
{
 Get current time as precise as possible.
 You can replace this function with anything suitable on your compiler.
 This version reads CPU clock counter with RDTSC instruction.
 It's then divided by the clock frequency - replace it with frequency of your CPU.
 I have 2.4 GHz Intel Core 2 processor.
 }
Function FineTime : Real;
Var
   frequency : Real = 2.4e9; { CPU frequency }
   clock     : Cardinal attribute (Size = 64);
begin
   asm volatile("rdtsc" : "=A" (clock));
   FineTime := clock / frequency;
end;
{ Count number of primes up to n using simple sieve of Eratosthenes. }
Function prime_count1(n : Integer) : Integer;
Type
   TSieve = Array[0..999999999] of Boolean;
   PSieve = ^TSieve;
Var       
   i           : Integer;
   j           : Integer;
   prime_count : Integer;
   prime       : PSieve; { dynamically allocated array for the sieve }
begin
   GetMem(prime, (n+1)*sizeof(Boolean)); { allocate the sieve array }
   FillChar(prime^, (n+1)*sizeof(Boolean), True); { fill it with ones }
   prime_count := 0;
   for i := 2 to n do
   begin
      if prime^[i] then { next prime found }
      begin
         Inc(prime_count);
         { mark all multiplies as non-primes: }
         j := i*2;
         while j <= n do
         begin
            prime^[j] := False;
            Inc(j, i);
         end;
      end;
   end;
   FreeMem(prime, (n+1)*sizeof(Boolean)); { free sieve array }
   prime_count1 := prime_count;
end;
{ run prime counting function and determine its runtime }
Procedure test1(n : Integer);
Var
   count : Integer;
   time  : Real;
begin
   time := FineTime();
   count := prime_count1(n);
   time := FineTime() - time;
   WriteLn('Number of primes up to ',n,' - ',count,'   time spent: ',time:0:3,' secs');
end;
   
begin
   test1(100000);
   test1(1000000);
   test1(10000000);
   test1(100000000);
end.
Цитата:
Неужели Вы не видите главного, в том, что вычисляется сам ряд чисел, а не проверяется какое-то одно?
Так ведь в решете Эратосфена тоже вычисляется сам ряд чисел.