r20445: add README file indicating that the swat directory is no longer relevant
[samba.git] / swat / apps / qooxdoo-examples / performance / NumberCreate_1.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4   <title>qooxdoo &raquo; Demo</title>
5   <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
6   <!--[if IE]>
7   <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
8   <![endif]-->
9   <script type="text/javascript" src="../../script/qx.js"></script>
10 </head>
11 <body>
12   <script type="text/javascript" src="../../script/layout.js"></script>
13
14   <div id="demoDescription">
15     <p>Tests for Number creation performance</p>
16     <ol>
17       <li>Using simple number</li>
18       <li>Using parseInt</li>
19       <li>Using parseFloat</li>
20       <li>Using new with string int</li>
21       <li>Using new with string float</li>
22       <li>Using new with simple number</li>
23       <li>Using new with parseInt</li>
24       <li>Using new with parseFloat</li>
25     </ol>
26   </div>
27
28   <script type="text/javascript">
29   qx.core.Init.getInstance().defineMain(function()
30   {
31     var n1 = "2392";
32     var n2 = "223.92";
33
34     function NumberCreate1(vLoops)
35     {
36       var foo;
37
38       for (var i=0; i<vLoops; i++) {
39         foo = 2392;
40       };
41     };
42
43     function NumberCreate2(vLoops)
44     {
45       var foo;
46
47       for (var i=0; i<vLoops; i++) {
48         foo = parseInt(n1);
49       };
50     };
51
52     function NumberCreate3(vLoops)
53     {
54       var foo;
55
56       for (var i=0; i<vLoops; i++) {
57         foo = parseFloat(n2);
58       };
59     };
60
61     function NumberCreate4(vLoops)
62     {
63       var foo;
64
65       for (var i=0; i<vLoops; i++) {
66         foo = new Number(n1);
67       };
68     };
69
70     function NumberCreate5(vLoops)
71     {
72       var foo;
73
74       for (var i=0; i<vLoops; i++) {
75         foo = new Number(n2);
76       };
77     };
78
79     function NumberCreate6(vLoops)
80     {
81       var foo;
82
83       for (var i=0; i<vLoops; i++) {
84         foo = new Number(2392);
85       };
86     };
87
88     function NumberCreate7(vLoops)
89     {
90       var foo;
91
92       for (var i=0; i<vLoops; i++) {
93         foo = new Number(parseInt(n1));
94       };
95     };
96
97     function NumberCreate8(vLoops)
98     {
99       var foo;
100
101       for (var i=0; i<vLoops; i++) {
102         foo = new Number(parseFloat(n2));
103       };
104     };
105
106     new qx.dev.TimeTracker(NumberCreate1, NumberCreate2, NumberCreate3, NumberCreate4, NumberCreate5, NumberCreate6, NumberCreate7, NumberCreate8);
107   });
108   </script>
109 </body>
110 </html>