File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
lib/node_modules/@stdlib/process/getuid/benchmark Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ // MODULES //
4+
5+ var bench = require ( '@stdlib/bench' ) ;
6+ var isNull = require ( '@stdlib/assert/is-null' ) ;
7+ var pkg = require ( './../package.json' ) . name ;
8+ var getuid = require ( './../lib/browser.js' ) ;
9+
10+
11+ // MAIN //
12+
13+ bench ( pkg + '::browser' , function benchmark ( b ) {
14+ var uid ;
15+ var i ;
16+
17+ b . tic ( ) ;
18+ for ( i = 0 ; i < b . iterations ; i ++ ) {
19+ // Note: the following *could* be optimized away via loop-invariant code motion. If so, the entire loop will disappear.
20+ uid = getuid ( ) ;
21+ if ( ! isNull ( uid ) ) {
22+ b . fail ( 'should return null' ) ;
23+ }
24+ }
25+ b . toc ( ) ;
26+ if ( ! isNull ( uid ) ) {
27+ b . fail ( 'should return null' ) ;
28+ }
29+ b . pass ( 'benchmark finished' ) ;
30+ b . end ( ) ;
31+ } ) ;
You can’t perform that action at this time.
0 commit comments