Skip to content

Commit

Permalink
Added ms counter
Browse files Browse the repository at this point in the history
  • Loading branch information
funniray committed Dec 2, 2018
1 parent 6ad7168 commit a638275
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Advent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@
</select>
<br>
<br>
<textarea name=data style="width:80vw; height:80vh">Insert data for puzzle here.</textarea>
<textarea name=data style="width:80vw; height:75vh">Insert data for puzzle here.</textarea>
<br>
<br>
<button type=button onClick="solve()"> solve </button>
</form>
<p id=solution></p>
<p id=time></p>
</body>
<header>
<script>
let solveDay = [];
function solve() {
const day = document.getElementsByName("day")[0].value.split("-");
const startTime = new Date().getTime();
const solution = solveDay[(day[0]-1)*2+(day[1]-1)](document.getElementsByName("data")[0].value.split("\n"));
document.getElementById("solution").innerHTML = solution;
document.getElementById("time").innerHTML = `It took ${new Date().getTime()-startTime}ms to solve this problem.`
}
function reqJS(day,part) {
let xhttp = new XMLHttpRequest();
Expand Down

0 comments on commit a638275

Please sign in to comment.