Basic loop in google sheets : Im trying to use a macro i made in excel in google sheets. This is my first time using this and i have it kinda working but seems real slow compared to excel. not sure whats going on and making it so slow. 

I have messed with the loop a bunch of different ways but still seems slow. it should only be running about 20-50 times.

the loop should be
When A is < B
then A = A+1



    function loopscript() {  
    var app = SpreadsheetApp;  
    var activeSheet = app.getActiveSpreadsheet().getActiveSheet();  
    var num1 = activeSheet.getRange(3, 2).getValue();  
    var num2 = activeSheet.getRange(4, 10).getValue();  
    for(var i=1;num2 < num1;i++){  
    var num3 = activeSheet.getRange(6, 2).setValue(i);  
    num2 = activeSheet.getRange(4, 10).getValue();  
    }  
    }