Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. [
  2. {
  3. "id": "c67af34f.cfd1",
  4. "type": "function",
  5. "z": "9b7d2645.a72f18",
  6. "name": "deltaT",
  7. "func": "\nvar prev = flow.get('prev')||0;\n\nvar d = new Date();\nvar n = d.getMilliseconds();\n\nif (msg.topic == \"timestamp\"){\n flow.set('prev', n);\n}\n \nelse {\n if (n<prev) {\n //console.log(\"OVERFLOW!\");\n n=n+1000;\n }\n //console.log(\"tDiff = \",n,\"-\",prev,\"=\",n-prev);\n console.log(n-prev);\n}\n\nreturn msg;",
  8. "outputs": 1,
  9. "noerr": 0,
  10. "x": 382.5,
  11. "y": 241,
  12. "wires": [
  13. [
  14. "da5c6847.6b87f8"
  15. ]
  16. ]
  17. }
  18. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement