ilhamdev commited on
Commit
205d2ba
·
verified ·
1 Parent(s): 2dde60d

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +3 -4
index.js CHANGED
@@ -12,7 +12,6 @@ const cheerio = require('cheerio')
12
  const cloudscraper = require('cloudscraper')
13
  const { File } = require('megajs')
14
  const { BingChat } = require("bing-chat-cjs-rnz");
15
- const { performance } = require('perf_hooks');
16
  let fetch;
17
 
18
  (async () => {
@@ -391,7 +390,7 @@ app.use(morgan('dev'));
391
  app.use(express.json());
392
 
393
  const v8 = require('v8');
394
- const start = performance.now();
395
 
396
  app.all('/', async (req, res) => {
397
  const status = {}
@@ -416,8 +415,8 @@ app.all('/', async (req, res) => {
416
  }
417
 
418
  const host = 'https://' + req.get('host');
419
- const end = performance.now(); // Selesai menghitung waktu
420
- const latency = (end - start).toFixed(4) + ' ms'; // Menghitung latency
421
 
422
  res.json({
423
  creator: `@${process.env['SPACE_AUTHOR_NAME'] || 'ALOK FF'}`,
 
12
  const cloudscraper = require('cloudscraper')
13
  const { File } = require('megajs')
14
  const { BingChat } = require("bing-chat-cjs-rnz");
 
15
  let fetch;
16
 
17
  (async () => {
 
390
  app.use(express.json());
391
 
392
  const v8 = require('v8');
393
+ const start = Date.now()
394
 
395
  app.all('/', async (req, res) => {
396
  const status = {}
 
415
  }
416
 
417
  const host = 'https://' + req.get('host');
418
+ const end = Date.now(); // Selesai menghitung waktu
419
+ const latency = Math.abs((end - start) / 1000)+ ' ms'; // Menghitung latency
420
 
421
  res.json({
422
  creator: `@${process.env['SPACE_AUTHOR_NAME'] || 'ALOK FF'}`,