|
DataMuseum.dkPresents historical artifacts from the history of: RC3500 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC3500 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 2304 (0x900) Types: TextFileVerbose Names: »ttimetest«
└─⟦2c55ea56f⟧ Bits:30001844 SW-save af projekt 1000, Alarm-system └─⟦6b41451d2⟧ └─⟦this⟧ »ttimetest«
job bbl 9 600 time 5 0 perm mini 30 2 size 92000 mode list.yes ( btimetest = set 1 mini scope user btimetest btimetest =pascal80 ioenvir finis) (*$ 1 1 1 *) (*********************** * lambda run time test * * test8 mini * * 81.01.11 * ***********************) process timetest( var sv : system_vector ); (* sort an array of integers *) const length = 2000; timerstart = 16000; (* countdown from... *) var number_of_turns, turn, step, step1, hp, hp1, limit : integer; list : array ( 1 .. length ) of integer; z_in, z_out : zone; pool_in, pool_out : pool 1 of opbuffer; mainsem : semaphore; begin openopzone( z_in, sv(operatorsem), ref( mainsem), 1, pool_in, 1, 0, 0, 0); openopzone( z_out, sv(operatorsem), ref( z_out.free), 1, pool_out, 2, 0, 0, 0); repeat outtext( z_out, 'number of tu'); outtext( z_out, 'rns, size ? #'); outend(z_out); opin(z_in); opwait( z_in, pool_in ); ininteger( z_in, number_of_turns ); ininteger (z_in, limit); if (limit <= 0) or (limit > length) then limit := length; outtext (z_out, 'arraysize = '); outinteger (z_out, limit, 1); outchar (z_out, nl); outtext( z_out, 'start#'); outchar( z_out, nl); outend( z_out ); own.timer := timerstart; definetimer (true); for turn := 1 to number_of_turns do begin (* initialize: worst case *) for step := 1 to limit do list ( step ) := step; for step := 1 to limit - 1 do begin hp := step; hp1 := list ( step ); for step1 := step + 1 to limit do if list ( step1 ) > hp1 then begin hp := step1; hp1 := list ( step1 ); end; list ( hp ) := list ( step ); list ( step ) := hp1; end; (* for step .... *) end; (* for turn ... *) outtext (z_out, 'seconds = #'); outinteger (z_out, timerstart - own.timer, 1); outchar (z_out, nl); outtext( z_out, 'stop #'); outinteger( z_out, number_of_turns, 1); outchar(z_out, nl); until number_of_turns <= 0; end. «eof»