How to trigger a JavaScript Function when the user does no interaction (being inactive) for 1 mins?

I have a web page that requires me to trigger a JavaScript function when the user is inactive for 1 min.

this page mainly consists of <form> component.

How to create a function that trigger after 1 min of inactivity?