'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var pkg = require( './../package.json' ).name;


// MAIN //

bench( pkg+'::float64array,control,constructor', function benchmark( b ) {
	var arr;
	var buf;
	var len;
	var i;

	buf = new ArrayBuffer( b.iterations*8 ); // 8 bytes per double
	arr = new Float64Array( buf, 0, b.iterations );
	len = b.iterations;

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		// Here, we are only testing the operation of creating a new view each time a value must be removed to a typed array:
		len -= 1;
		arr = new Float64Array( arr.buffer, arr.byteOffset, len );
		if ( arr.length !== len ) {
			b.fail( 'should have removed an element' );
		}
	}
	b.toc();
	if ( arr.length !== 0 ) {
		b.fail( 'should have removed elements' );
	}
	b.pass( 'benchmark finished' );
	b.end();
});


'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var pkg = require( './../package.json' ).name;


// MAIN //

bench( pkg+'::float64array,control,constructor', function benchmark( b ) {
	var arr;
	var buf;
	var len;
	var i;

	buf = new ArrayBuffer( b.iterations*8 ); // 8 bytes per double
	arr = new Float64Array( buf, 0, b.iterations );
	len = b.iterations;

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		// Here, we are only testing the operation of creating a new view each time a value must be removed from a typed array:
		len -= 1;
		arr = new Float64Array( arr.buffer, arr.byteOffset, len );
		if ( arr.length !== len ) {
			b.fail( 'should have removed an element' );
		}
	}
	b.toc();
	if ( arr.length !== 0 ) {
		b.fail( 'should have removed elements' );
	}
	b.pass( 'benchmark finished' );
	b.end();
});


Change word