Question: I'm trying to implement a setInterval() method but I'm not sure exactly where to put it. Basically, I want this whole JavaScript script to run every minute or so. I think the code that I want to add is the one line I have added below, but I don't know exactly where to put it, and I don't know what the first parameter should be (although I know it should be the name of the function that I want to call).

```
setInterval(myTimer, 60000);

```

And here's the full code:

```
<!DOCTYPE html>
<html>
<head>
    <title>Ethereum Tracker</title>
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script>
        $(document).ready(function(){
            let myData = "";
            let dataTest = "";
            $.get("https://api.coinmarketcap.com/v1/ticker/ethereum/", function(data, status){
                myData = data[0];
                document.getElementById("p1").innerHTML = (myData.price_usd);
            });
        });
    </script>
</head>
<body>
    <p id="p1"></p>
    <p id="p2"></p>
    <script>
        var d = new Date();
        document.getElementById("p2").innerHTML = 'Last updated: ' + d.toLocaleTimeString();
    </script>
</body>
</html>

```

Answer: 
You would need to do something like this

```
<!DOCTYPE html>
<html>
<head>
    <title>Ethereum Tracker</title>
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script>
        function update(){
            let myData = "";
            let dataTest = "";
            $.get("https://api.coinmarketcap.com/v1/ticker/ethereum/", function(data, status){
                myData = data[0];
                $("#p1").html(myData.price_usd);

                var d = new Date();
                $("#p2").html('Last updated: ' + d.toLocaleTimeString());
            });
        }

        $(document).ready(function(){
            // run every minute
            setInterval(update, 60000);
            // run immediately on load
            update(); 
        });
    </script>
</head>
<body>
    <p id="p1"></p>
    <p id="p2"></p>
</body>
</html>

```
Assuming you want to update the price every minute, it should look like:

```
$(document).ready(function(){
    setInterval(updatePrice,60000);
});    
function updatePrice(){
    let myData = "";
    let dataTest = "";
    $.get("https://api.coinmarketcap.com/v1/ticker/ethereum/", 
    function(data, status){
            myData = data[0];
            document.getElementById("p1").innerHTML =(myData.price_usd);
        });
    }

```