Making Samples executable. #!/usr/bin/env io and chmod a+x *.io
[io/quag.git] / samples / speed / speedResults2.io
blob8b30ae77233ec7389069030c5ff542b718de0c27
1 #!/usr/bin/env io
4 template := """
5 <table cellpadding=3 cellspacing=0 border=0>
6 <tr>
8 <td bgcolor=#888888 width=70>
9 <font color=white face="helvetica, arial, sans">
10 @name@
11 </td>
13 <td bgcolor=@color@ width=@length@>
14 <font color=white face="helvetica, arial, sans">
15 <font color=@fontColor@>@time@</font>
16 </td>
18 </tr>
19 </table>
20 """
23 Io := Object clone
24 Python := Object clone
26 s := File setPath(Path with(launchPath, "SpeedResults")) asString
28 doString(s)
30 slotNames := list("localAccesses", "localSets", "slotAccesses", "slotSets", "blockActivations", "instantiations")
32 show := method(name, value, color, fontColor,
33 t := template asBuffer
34 t replace("@name@", name)
35 t replace("@time@", value asString(0, 1) )
36 t replace("@length@", (value * 30) asString(0, 0))
37 t replace("@color@", color)
38 t replace("@fontColor@", fontColor)
39 write(t, "\n\n")
42 slotNames foreach(slot,
43 write("<table cellpadding=0 cellspacing=1 border=0><tr>")
44 write("<td rowspan=2 bgcolor=#888888 width=120><font color=white face=\"helvetica, arial, sans\">&nbsp;&nbsp;", slot, "</td><td>")
45 show("Io", Io getSlot(slot), "#9999cc", "#bbbbee")
46 show("Python", Python getSlot(slot), "#888888", "#aaaaaa")
47 write("</td></tr></table>\n")