home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-06 | 2.1 KB | 106 lines | [TEXT/PJMM] |
- program TimeTrig;
-
- { Time Trig XXXX programs. }
- { These programs were used to test the performance mentioned in appendix A of the }
- { FastPerfTrigs documentation. The 030/881 version used a specially compiled version }
- { of the library that is not supplied with this package sinc it is slower than the direct FPU }
- { calls. }
- {}
- { © 1992 by Christian Franz }
- {}
- {}
-
-
- uses
- FastPerfTrigs;
-
- const
- thevalue = 42.18928;
- Tries = 1000;
-
- var
- Start, Stop, SysClick, FastClicks: LongInt;
- i: longint;
- x, y: real;
- Trect: rect;
-
- begin
- SetRect(Trect, 0, 20, 512, 380);
- SetTextRect(Trect);
- ShowText;
- if InitTrigs <> noerr then
- writeln('Init error')
- else
- begin
- Writeln('-------------');
- Writeln('Performance Test. Tries : ', Tries, '. Compiled 68000 ');
- writeln;
- Write('Beginning : Sine - Test: System ');
- Start := TickCount;
- for i := 1 to Tries do
- begin
- x := sin(thevalue);
- end;
- Stop := TickCount;
- SysClick := Stop - Start;
- write(SysClick);
-
- Write(' TableLookup : ');
- Start := TickCount;
- for i := 1 to Tries do
- begin
- x := Fsin(thevalue);
- end;
- Stop := TickCount;
- FastClicks := Stop - Start;
- write(FastClicks);
- writeln;
- writeln;
-
- Write('Beginning : Cosine - Test: System ');
- Start := TickCount;
- for i := 1 to Tries do
- begin
- x := cos(thevalue);
- end;
- Stop := TickCount;
- SysClick := Stop - Start;
- write(SysClick);
-
- Write(' TableLookup : ');
- Start := TickCount;
- for i := 1 to Tries do
- begin
- x := FCos(thevalue);
- end;
- Stop := TickCount;
- FastClicks := Stop - Start;
- write(FastClicks);
- writeln;
- writeln;
-
- Write('Beginning : Tangens - Test: System ');
- Start := TickCount;
- for i := 1 to Tries do
- begin
- x := tan(thevalue);
- end;
- Stop := TickCount;
- SysClick := Stop - Start;
- write(SysClick);
-
- Write(' TableLookup : ');
- Start := TickCount;
- for i := 1 to Tries do
- begin
- x := FTan(thevalue);
- end;
- Stop := TickCount;
- FastClicks := Stop - Start;
- write(FastClicks);
- writeln;
- writeln;
- repeat
- until button;
- end;
- end.