Skip to content

Instantly share code, notes, and snippets.

@tonmcg
Created May 24, 2018 00:55
Show Gist options
  • Select an option

  • Save tonmcg/ad4d161231a226c670c47bffe529a23e to your computer and use it in GitHub Desktop.

Select an option

Save tonmcg/ad4d161231a226c670c47bffe529a23e to your computer and use it in GitHub Desktop.

Revisions

  1. tonmcg created this gist May 24, 2018.
    35 changes: 35 additions & 0 deletions UseJavaScript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    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