so, CPU went up to 100%, that's only one explanation, while there's no other processes, your code will be executed. That doesn't mean your other applications can do their work in normal performance. But for showing a good example of use with doevents, that's pretty useless because all loops have different tasks to performe. The more intensive, the more doevents you need. And you need to put them in strategic places where they can't be too overused. It will drain on performance.

Do while active
'Code...
Doevents
Loop

Another feature is when you close your application while a loop is running, it may hang up. To solve this your loop must have a exit path, the boolean (active) condition (you can have that one public in a module if you have several forms.

For code executed while your app runs independent from which form is closed or not, you could have sub main in a module as the startup object and run the code loop there. If you want to split parts of code to be execute in different intervals, use the same loop, put gettickcount api to count the intervals and use separate variables to wait for an active condition.
Code:
    secloop = GetTickCount: msloop = secloop
    Do While Forms.Count
        
        If msloop < GetTickCount Then
            msloop = msloop + 1
            'code executed each millisecond
        End If
        
        If secloop < GetTickCount Then
            secloop = secloop + 1000
            'code executed each second
        End If
        
        For temp = 0 To threadconst 'Threading
            DoEvents
        Next temp
    
    Loop