How to update this formula so it automatically updates?

First time on here, it’s come to my attention that GoogleClock no longer works on new sheets, anyway I can update the below code so it can update every minute.

Tried put =SheetNames(NOW()) it says not allowed. I’m very new to scripts (below script I found on here)

Help appreciated 🙂

function SheetNames() { // Usage as custom function: =SheetNames( GoogleClock() ) try { var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets() var out = new Array( sheets.length+1 ) ; //out[0] = [ “Name” , “gid” ]; for (var i = 3 ; i < sheets.length+1 ; i++ ) out[i-7] = [sheets[i-1].getName()]; return out } catch( err ) { return “#ERROR!”

SheetNames.flush(); } }