Is it possible to wait for seconds instead of frames?

So for some reason I decided it'd be a good idea to put a rhythm game mini-game in my current project.
I've put together the basic gameplay. Notes fly across the screen and you can hit them if you time it right, or miss them if you don't.

Since its supposed to be like a rhythm game, everything should probably be synced up with the music. But since the game doesn't run at a consistent perfect 60 fps at all times no matter what, waiting a certain amount of frames before spawning a note in is gonna desync the game with the music.
Is there a way to get it count seconds instead of frames? Preferably down to the hundredth of a second. Or alternatively, is there a way to get the current position of the song playing and base the spawning of notes off of that instead?
not by eventing - and if you try to get to scripts then from your description it might be better to let the entire game be handled by a plugin, skipping the event framework.


or you could go the other route and try to find out what is lagging your game.
most modern computers have enough resources to keep at 60fps (actually higher, the engine artificially limits this to 60fps if more resources would be available), unless you're either having problems with parallel processes or if you have excessive RAM usage due to parallax mapping or event spawning or something like that.

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-wait-for-seconds-instead-of-frames.141625/