File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,18 @@ $(function() {
6
6
}
7
7
running = true ;
8
8
9
- var graph = new Graph ( grid ) ;
10
- var start = graph . grid [ 0 ] [ 0 ] ;
11
- var end = graph . grid [ 140 ] [ 140 ] ;
12
- var results = [ ] ;
13
- var times = 0 ;
14
-
9
+ var graph = new Graph ( grid ) ,
10
+ start = graph . grid [ 0 ] [ 0 ] ,
11
+ end = graph . grid [ 140 ] [ 140 ] ,
12
+ results = [ ] ,
13
+ times = 0 ;
14
+
15
15
for ( var i = 0 ; i < 1000 ; i ++ ) {
16
- var startTime = performance ? performance . now ( ) : new Date ( ) . getTime ( ) ;
17
- var result = astar . search ( graph , start , end ) ;
18
- var endTime = performance ? performance . now ( ) : new Date ( ) . getTime ( ) ;
16
+ var startTime = performance ? performance . now ( ) : new Date ( ) . getTime ( ) ,
17
+ result = astar . search ( graph , start , end ) ,
18
+ endTime = performance ? performance . now ( ) : new Date ( ) . getTime ( ) ;
19
19
times = times + ( endTime - startTime ) ;
20
-
20
+
21
21
results . push (
22
22
'<li>Found path with ' + result . length + ' steps. ' +
23
23
'Took ' + ( endTime - startTime ) . toFixed ( 2 ) + ' milliseconds.</li>'
You can’t perform that action at this time.
0 commit comments