>How to make a time based regular function?
>Like something that plays a sound every 1 second?
To what end? If all you want to do is hog the process and play a sound every second, it's a trivial matter:
But if you want something to happen while that function is running, you get into troublesome code such as faking multithreading, using actual threads, or spawning a separate process. How you're going to use the function plays a big part in how it needs to be implemented.