Created
June 25, 2017 16:00
Revisions
-
jeromeetienne created this gist
Jun 25, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ <script src="https://www.gstatic.com/firebasejs/4.1.3/firebase.js"></script> <script> // Initialize Firebase var config = { // YOUR CONFIG goes here - https://firebase.google.com/docs/web/setup#add_firebase_to_your_app }; var firebaseApp = firebase.initializeApp(config); var rootRef = firebase.database().ref(); // Get a reference to the /users/ada node var adaRef = firebase.database().ref("users/ada"); adaRef.on('value', function(snapshot){ console.log('latency', Date.now() - snapshot.val().time); }); </script> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <script src="https://www.gstatic.com/firebasejs/4.1.3/firebase.js"></script> <script> // Initialize Firebase var config = { // YOUR CONFIG goes here - https://firebase.google.com/docs/web/setup#add_firebase_to_your_app }; var firebaseApp = firebase.initializeApp(config); var rootRef = firebase.database().ref(); // Get a reference to the /users/ada node var adaRef = firebase.database().ref("users/ada"); adaRef.set({ arApp: 'loaded' }); setInterval(function(){ console.log('time') adaRef.set({ time : Date.now() }); }, 100) </script>