Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
ai
Commits
05aaa787
Commit
05aaa787
authored
Apr 14, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
f9844b1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
22 deletions
+7
-22
test_time.js
test_time.js
+4
-21
uniq2.js
uniq2.js
+3
-1
No files found.
test_time.js
View file @
05aaa787
var
startTime
=
performance
.
now
()
const
fs
=
require
(
'
fs
'
);
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
)
}
// <---- measured code goes between startTime and endTime
var
endTime
=
performance
.
now
()
function
getDaysDiff
(
start
,
closed
)
{
//2019-05-25T05:34:27+04:30
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
console
.
log
(
`Call to doSomething took
${
endTime
-
startTime
}
milliseconds`
)
\ No newline at end of file
uniq2.js
View file @
05aaa787
...
...
@@ -16,7 +16,7 @@ async function run() {
let
total
=
[]
let
levelPlus
=
[]
let
types
=
[]
var
startTime
=
performance
.
now
()
for
(
let
i
=
0
;
i
<
configs
.
length
;
i
++
)
{
...
...
@@ -41,6 +41,8 @@ async function run() {
}
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
z
=
i
+
1
;
z
<
adder
.
length
;
z
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment