I am new to Gatling, Can someone please advise me if Gatling pace can be used to refresh the token periodically in the virtual user?
You could want to control how frequently an action is executed, to target iterations per time type volumes. Gatling supports a dedicated type of pause: pace, which adjusts its wait time depending on the elapsed time since the virtual user last reached this action. E.g.:
// will be run every 5 seconds, irrespective of what pause time is used