-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequirejs.html
50 lines (44 loc) · 2.03 KB
/
requirejs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title>StopWatchJS</title>
</head>
<body data-stopwatch="1">
<h1>StopWatchJS</h1>
<script type="text/javascript"
src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.22/require.js"></script>
<script type="text/javascript">
require.config({
paths: {
"StopWatch": "../src"
}
});
define('main',['StopWatch/StopWatch'],function(StopWatch){
require([
'StopWatch/StopWatchExporter/SymfonyExporter',
'StopWatch/StopWatchViewer/SymfonyViewer'
],function(SymfonyExporter,SymfonyViewer) {
var section = null;
StopWatch.start('initialisation','section');
StopWatch.start('R.js','loading');
var i = setInterval(function(){ StopWatch.lap('R.js'); },100);
setTimeout(function(){ clearInterval(i); StopWatch.stop('R.js'); StopWatch.stop('initialisation'); },500);
setTimeout(function(){ StopWatch.start('working','section'); },500);
setTimeout(function(){ section = StopWatch.openSection('SubProcess'); },550);
setTimeout(function(){ section.start('render','template'); },600);
setTimeout(function(){ section.stop('render'); },800);
setTimeout(function(){ StopWatch.closeSection(section); },900);
setTimeout(function(){ StopWatch.stop('working'); },1000);
setTimeout(function(){
var exporter = new SymfonyExporter();
exporter.setStopWatch(StopWatch);
var viewer = new SymfonyViewer();
viewer.setStopWatchExporter( exporter );
viewer.open();
},1250);
});
});
require(['main']);
</script>
</body>
</html>