Timestamp (date/time) when Google Sheets Stocks Portfolio is auto-updated using Google Finance data

My Google Sheets stocks portfolio auto updates from Google Finance. Is there a way to timestamp the last auto-update ? The below script works fine if I EDIT any cell but not when it auto-updates?

function onEdit(){
SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“Portfolio”).getRange(“AI1”).setValue(new Date());