Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zbNode
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
ken
zbNode
Commits
d3d94886
Commit
d3d94886
authored
Apr 27, 2018
by
ken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
试试看吧
parent
9465a4fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
testSpeed.js
testSpeed.js
+3
-1
No files found.
testSpeed.js
View file @
d3d94886
...
...
@@ -4,6 +4,7 @@ let total = 0;
let
total2
=
0
;
let
time
=
0
;
let
lastData
=
null
;
let
lastTimestamp
=
0
;
setInterval
(()
=>
{
run
();
...
...
@@ -22,10 +23,11 @@ function run() {
total2
+=
((
after
-
before
)
-
total
/
time
)
*
((
after
-
before
)
-
total
/
time
);
// console.log('平均值:' + (total / time) + ' 标准差:' + Math.sqrt(total2 / time));
// console.log(data);
if
(
lastData
)
{
if
(
lastData
&&
data
.
timeStamp
>
lastTimestamp
)
{
if
(
JSON
.
stringify
(
lastData
)
!=
JSON
.
stringify
(
data
))
{
console
.
log
(
"diff@"
+
data
.
timestamp
)
}
lastTimestamp
=
data
.
timeStamp
;
}
lastData
=
data
;
});
...
...
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