Commit 05aaa787 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent f9844b1d
var startTime = performance.now()
const fs = require('fs'); // <---- measured code goes between startTime and endTime
let moment=require('moment-timezone')
//tesT()
let closeTime=1611750600000
let openTime=1611304200000
tesT()
function tesT()
{
let d=getMinDiff('2012-10-2','2012-10-10')
console.log(d)
}
var endTime = performance.now()
function getDaysDiff(start, closed) { console.log(`Call to doSomething took ${endTime - startTime} milliseconds`)
//2019-05-25T05:34:27+04:30 \ No newline at end of file
var now = moment(moment(closed,'YYYY-MM-DD').format());
var end = moment.duration(now.diff(moment(start,'YYYY-MM-DD')));
// console.log(parseInt(end.asDays()))
return parseInt(end.asDays())
}
//fs.appendFileSync('error.txt', 'test new line\n');
\ No newline at end of file
...@@ -16,7 +16,7 @@ async function run() { ...@@ -16,7 +16,7 @@ async function run() {
let total = [] let total = []
let levelPlus = [] let levelPlus = []
let types = [] let types = []
var startTime = performance.now()
for (let i = 0; i < configs.length; i++) { for (let i = 0; i < configs.length; i++) {
...@@ -41,6 +41,8 @@ async function run() { ...@@ -41,6 +41,8 @@ async function run() {
} }
adder = _.orderBy(adder, ['total'], ['asc']); adder = _.orderBy(adder, ['total'], ['asc']);
var endTime = performance.now()
console.log(`Call to doSomething took ${endTime - startTime} milliseconds`)
for (let i = 0; i < adder.length; i++) { for (let i = 0; i < adder.length; i++) {
for (let z = i + 1; z < adder.length; z++) { for (let z = i + 1; z < adder.length; z++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment