(* Collection of code snippets by Arne Vajhøj *)
(* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) *)
program cvtperf;

{$APPTYPE CONSOLE}

uses
  Windows, SysUtils;

const
  n = 1000000000;

procedure dummy(v : int64);

begin
  if v <> 123 then begin
    abort;
  end;
end;

var
  i,t1,t2,t3,t4 : integer;
  vsi : shortint;
  vi64 : int64;

begin
  t1 := GetTickCount;
  vi64 := 123;
  for i := 1 to n do begin
    dummy(vi64);
  end;
  t2 := GetTickCount;
  t3 := GetTickCount;
  vsi := 123;
  for i := 1 to n do begin
    vi64 := vsi;
    dummy(vi64);
  end;
  t4 := GetTickCount;
  writeln(1000.0*n/((t4-t3)-(t2-t1)));
end.
