Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 18.190.239.189
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/node_modules/npm/node_modules/worker-farm/examples/pi/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/node_modules/npm/node_modules/worker-farm/examples/pi/index.js
'use strict'

const CHILDREN         = 500
    , POINTS_PER_CHILD = 1000000
    , FARM_OPTIONS     = {
          maxConcurrentWorkers        : require('os').cpus().length
        , maxCallsPerWorker           : Infinity
        , maxConcurrentCallsPerWorker : 1
      }

let workerFarm = require('../../')
  , calcDirect = require('./calc')
  , calcWorker = workerFarm(FARM_OPTIONS, require.resolve('./calc'))

  , ret
  , start

  , tally = function (finish, err, avg) {
      ret.push(avg)
      if (ret.length == CHILDREN) {
        let pi  = ret.reduce(function (a, b) { return a + b }) / ret.length
          , end = +new Date()
        console.log('π ≈', pi, '\t(' + Math.abs(pi - Math.PI), 'away from actual!)')
        console.log('took', end - start, 'milliseconds')
        if (finish)
          finish()
      }
    }

  , calc = function (method, callback) {
      ret   = []
      start = +new Date()
      for (let i = 0; i < CHILDREN; i++)
        method(POINTS_PER_CHILD, tally.bind(null, callback))
    }

console.log('Doing it the slow (single-process) way...')
calc(calcDirect, function () {
  console.log('Doing it the fast (multi-process) way...')
  calc(calcWorker, process.exit)
})

Youez - 2016 - github.com/yon3zu
LinuXploit