File tree Expand file tree Collapse file tree 1 file changed +28
-18
lines changed
lib/node_modules/@stdlib/utils/properties/benchmark Expand file tree Collapse file tree 1 file changed +28
-18
lines changed Original file line number Diff line number Diff line change @@ -28,31 +28,41 @@ var pkg = require( './../package.json' ).name;
28
28
var properties = require ( './../lib' ) ;
29
29
30
30
31
+ // FUNCTIONS //
32
+
33
+ /**
34
+ * Constructor function for creating benchmark test objects.
35
+ *
36
+ * @private
37
+ * @constructor
38
+ * @returns {Foo } Foo instance
39
+ */
40
+ function Foo ( ) {
41
+ this . a = 'beep' ;
42
+ this . b = 'boop' ;
43
+ this . c = [ 1 , 2 , 3 ] ;
44
+ this . d = { } ;
45
+ this . e = null ;
46
+ this . f = randu ( ) ;
47
+ defineProperty ( this , 'g' , {
48
+ 'value' : 'bar' ,
49
+ 'configurable' : true ,
50
+ 'writable' : true ,
51
+ 'enumerable' : false
52
+ } ) ;
53
+ return this ;
54
+ }
55
+
56
+ Foo . prototype . h = [ 'foo' ] ;
57
+
58
+
31
59
// MAIN //
32
60
33
61
bench ( pkg , function benchmark ( b ) {
34
62
var out ;
35
63
var obj ;
36
64
var i ;
37
65
38
- function Foo ( ) {
39
- this . a = 'beep' ;
40
- this . b = 'boop' ;
41
- this . c = [ 1 , 2 , 3 ] ;
42
- this . d = { } ;
43
- this . e = null ;
44
- this . f = randu ( ) ;
45
- defineProperty ( this , 'g' , {
46
- 'value' : 'bar' ,
47
- 'configurable' : true ,
48
- 'writable' : true ,
49
- 'enumerable' : false
50
- } ) ;
51
- return this ;
52
- }
53
-
54
- Foo . prototype . h = [ 'foo' ] ;
55
-
56
66
obj = new Foo ( ) ;
57
67
58
68
b . tic ( ) ;
You can’t perform that action at this time.
0 commit comments