As bruteforce mentioned, the while loop is not needed, and not recommended. You want to work with the delta time provided by the game loop itself.
For your problem, you want to control the speed by time. As an example say you wanted something to rotate 360 degrees over 5 seconds, this is the general idea for achieving that.
var seconds = 5
var rot_d_per_second = 360 / seconds
var angle = get_rotd()
angle += rot_d_per_second * delta
On a side note, you might want to be careful when doing accumulations on angles. Floating point inaccuracy issues can creep into that.