list = {5, 9, 1, 8, 2}; result = dialog("Before " + string(list)); sortedlist = sortlist(list, true); result = dialog("After " + string(sortedlist));
list = {"f", "b", "a", "e", "d"}; result = dialog("Before " + string(list)); sortedlist = sortlist(list, false); result = dialog("After " + string(sortedlist));
sub performancetest(count) list = {}; repeat for inx from 1 to count list = list + inx; endrepeat result = dialog("list ready to sort"); list = sortlist(list, false); result = dialog("list sorted"); finished = false; inx = 1; repeat while not finished if list[inx] < list[inx + 1] then msg = "List not sorted at "; msg = msg + "list["; msg = msg + string(inx); msg = msg + "] = "; msg = msg + string(list[inx]); msg = msg + " list["; msg = msg + string(inx + 1); msg = msg + "] = "; msg = msg + string(list[inx + 1]); result = dialog(msg); finished = true; else inx = inx + 1; if inx >= count then finished = true; endif endif endrepeat endsub performancetest(250);The timing results were calculated from when the sort started until when the sort ended. The performance results using a preliminary retail build of QW 4.7.06 were as follows:
Date: | February 22, 1999 at 5:55 PM (Pacific) |
Person: | David |
Machine: | Vectra XU |
CPU: | Dual Pentium 133 |
Memory: | 128 MB |
OS: | WinNT 4.0 SP3 |
Timing: | 18 elapsed seconds for 250 entries |
Date: | February 22, 1999 at 8:00 PM (Mountain) |
Person: | Neil |
Machine: | Dell Dimension xps D300 |
CPU: | Pentium II 300 Mhz |
Memory: | 64 MB |
OS: | WinNT 4.0 SP3 |
Timing: | 6 elapsed seconds for 250 entries |