source: ISOcat/trunk/mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/pagebus/samples/perf/perf.htm @ 2029

Last change on this file since 2029 was 2029, checked in by mwindhouwer, 12 years ago

Initial import of all the *cats, i.e., ISOcat, RELcat and SCHEMAcat.

File size: 2.3 KB
Line 
1<!--
2(c) 2007 TIBCO Software Inc. Use, modification, and distribution subject to terms of license.
3-->
4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
5        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
7<head>
8 <title>TIBCO(R) PageBus Sample</title>
9 <script type="text/javascript" src="../../js/pagebus.js"></script>
10 <link rel="stylesheet" type="text/css" href ="../demo.css"/>
11</head>
12<body id="body-area">
13
14<table class="banner-area">
15 <tr>
16  <th></th>
17  <td></td>
18 </tr>
19</table>
20
21<div id="panes">
22 <div id="pane1">
23
24 <div class="component">
25  <div class="component-title">Simple Performance Sample</div>
26  <div class="component-body">
27   <div style="padding: 5px; margin: 5px;">
28    <p>Click the links. Press Start.</p>
29    <form method="get" action="#" id="bench">
30     <input type="text" id="index1" value="-"/><br/><br/>
31     <a href="#" onClick="javascript:doBenchmark(false, 50000);return false;">50,000 invisible iterations</a><br/><br/>
32     <a href="#" onClick="javascript:doBenchmark(true, 5000);return false;">5,000 visible iterations</a>
33    </form>
34   </div>
35  </div>
36 </div>
37 
38
39<script language="JavaScript">
40
41var show = false;
42
43function onMessage(subject, message, closure) {
44
45       var v1 = message.messageType;
46       var v2 = message.value1;
47       var v3 = message.another;
48       var v4 = message.index;
49
50       if(show) { 
51          document.getElementById("index1").value = v4; 
52       }
53}
54
55var subHandle = window.PageBus.subscribe("oneTokenSubject", null, onMessage, null);
56
57function doBenchmark(showValues, iterations) 
58{
59      show = showValues;
60      var ev = { 
61         messageType: "com.tibco.eg.MyMessageType", 
62         value1: "00001", 
63         another: "ABC-123", 
64         index:"" 
65      };
66
67      alert("Start Now");
68
69      var date0 = new Date();
70     
71      var i;
72      for(i = 0; i  < iterations; i++) {
73          ev.index = "index:" + i;
74          window.PageBus.publish("oneTokenSubject", ev);
75      }
76
77      var date1 = new Date();
78      alert(i + " iterations\n\rTime started: " + date0.toLocaleString() + "\n\rTime stopped: " +
79             date1.toLocaleString());
80
81}
82
83</script>
84
85</div>
86</div>
87</body>
88</html>
Note: See TracBrowser for help on using the repository browser.