Created
May 24, 2018 00:55
-
-
Save tonmcg/ad4d161231a226c670c47bffe529a23e to your computer and use it in GitHub Desktop.
M Language XHR Functions
This file contains 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 characters
let | |
javascriptDates = Web.Page(" | |
<script type='text/javascript'> | |
function wait(ms){ | |
var start = new Date().getTime(); | |
var end = start; | |
while(end < start + ms) { | |
end = new Date().getTime(); | |
} | |
} | |
time = new Date(); | |
document.write('<p>',time,'</p>'); | |
wait(7000); | |
time1 = new Date(); | |
document.write('<p>',time1,'</p>'); | |
</script> | |
"){0}[Data]{0}[Children]{1}[Children][Children], | |
count = List.Count(javascriptDates), | |
readDates = | |
List.Generate( | |
()=> | |
[ | |
n = 0, | |
text = javascriptDates{n}[Text]{0} | |
], // initial | |
each [n] < count, // condition | |
each | |
[ | |
n = [n] + 1, | |
text = javascriptDates{n}[Text]{0} | |
], // next | |
each [text] // selector | |
) | |
in | |
readDates |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment