Luc
0
Q:

setValues()

setInterval(function(){ 
	console.log("Oooo Yeaaa!");
}, 2000);//run this thang every 2 seconds
51
SpreadsheetApp.getActive().getRange("A1").setValue('abc');
1
setInterval(function(){ 
	console.log("print this once every 3 second");
}, 3000);//run this thang every 3 seconds
5
setInterval(function(){
  console.log("Hello");
  console.log("World");
}, 2000); //repeat every 2s
0
function func(){
  console.log("Ran")
}
setInterval(func,1000)//Runs the "func" function every second
9
setInterval(function() {
  //Your code
}, 1000); //Every 1000ms = 1sec
2
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];

// The size of the two-dimensional array must match the size of the range.
var values = [
  [ "2.000", "1,000,000", "$2.99" ]
];

var range = sheet.getRange("A1:C1");
range.setValues(values);
0
<!DOCTYPE html>
<html>
<head>
    <title>setInterval</title>
    <script type="text/javascript">
      
        let interval;
      
        function startInterval(){
          interval = setInterval(appendDateToBody, 1000);
          console.log(interval);
        }
 
        function appendDateToBody() {
            document.body.appendChild(
                document.createTextNode(new Date() + " "));
        }

        function stopInterval() {
            clearInterval(interval);
          console.log(interval);
        }
    </script>
</head>
<body>
    <input type="button" value="Stop" onclick="stopInterval();" />
  <input type="button" value="Start" onclick="startInterval();" />
</body>
</html>
0

New to Communities?

Join the community