-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathworker.html
More file actions
33 lines (33 loc) · 1.09 KB
/
worker.html
File metadata and controls
33 lines (33 loc) · 1.09 KB
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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
.div{
width: 100px;
height: 100px;
background: red;
}
</style>
<title>web worker fibonacci</title>
<script type="text/javascript">
// window.onload =function(){
// var worker =new Worker('./a.js');
// worker.addEventListener('message', function(event) {
// var timer2 = (new Date()).valueOf();
// console.log( '结果:'+event.data, '时间:'+ timer2, '用时:'+ ( timer2 - timer ) );
// }, false);
// var timer = (new Date()).valueOf();
// console.log('开始计算:40','时间:'+ timer );
// setTimeout(function(){
// console.log('定时器函数在计算数列时执行了', '时间:'+ (new Date()).valueOf() );
// },1000);
// worker.postMessage(40);
// console.log('我在计算数列的时候执行了', '时间:'+ (new Date()).valueOf() );
// }
</script>
</head>
<body>
<div class="div"></div>
</body>
</html>