Oops my bad, sleep_time should be an integer:
new codeFrom the output it looks to me like everything is working as expected.
Every (40 +- 1) ms the sprite is rotated by 3.6 degrees, I don't understand why the rotation looks so choppy.
0, 1
3.6, 40
7.2, 80
10.8, 120
14.4, 161
18, 201
21.6, 241
25.2, 281
28.8, 320
32.4, 361
36, 401
39.6, 441
43.2, 481
46.8, 521
50.4, 561
54, 601
57.6, 640
61.2, 681
64.8, 720
68.4, 760
72, 801
75.6, 841
79.2, 880
82.8, 921
86.4, 961
90, 1000