Blueforcer Well-Known Member Licensed User Longtime User Jul 18, 2018 #1 I use the b4j bridge to debug my Programm on an 64Bit Pine64 with 4x1,15Ghz. unfortunately the CPU usage is very high for my feeling. between 60 and 100% all the time. my test program doesn't actually do much. it's just rotate a pane with css and a timer. Even in releasemode the cpu load doesnt drop below 50%. does anyone have an explanation for me?
I use the b4j bridge to debug my Programm on an 64Bit Pine64 with 4x1,15Ghz. unfortunately the CPU usage is very high for my feeling. between 60 and 100% all the time. my test program doesn't actually do much. it's just rotate a pane with css and a timer. Even in releasemode the cpu load doesnt drop below 50%. does anyone have an explanation for me?
jahswant Well-Known Member Licensed User Longtime User Jul 18, 2018 #2 Your code will tell us what's wrong. Upvote 0
Blueforcer Well-Known Member Licensed User Longtime User Jul 18, 2018 #3 Nothing special Code: t.Initialize("timer",100) t.Enabled=True Sub timer_tick angle=angle+2 If angle = 360 Then angle =0 CSSUtils.SetStyleProperty(Pane1, "-fx-rotate",angle) End Sub Upvote 0
Nothing special Code: t.Initialize("timer",100) t.Enabled=True Sub timer_tick angle=angle+2 If angle = 360 Then angle =0 CSSUtils.SetStyleProperty(Pane1, "-fx-rotate",angle) End Sub
jahswant Well-Known Member Licensed User Longtime User Jul 18, 2018 #4 Try disable timer and see the results. Upvote 0
Blueforcer Well-Known Member Licensed User Longtime User Jul 18, 2018 #5 then there is no cpu load. But i think a 100ms timer should not push a Quadcore so high? Even 500ms need 40% Upvote 0
then there is no cpu load. But i think a 100ms timer should not push a Quadcore so high? Even 500ms need 40%
Blueforcer Well-Known Member Licensed User Longtime User Jul 18, 2018 #7 I am aware that a lower interval increases the CPU load. But 500ms should not be a problem for such a processor. especially since the timer runs in a thread. With a raspberry 1 or 2 I wouldn't be too surprised, but not with such powerful hardware. Upvote 0
I am aware that a lower interval increases the CPU load. But 500ms should not be a problem for such a processor. especially since the timer runs in a thread. With a raspberry 1 or 2 I wouldn't be too surprised, but not with such powerful hardware.
Erel B4X founder Staff member Licensed User Longtime User Jul 18, 2018 #8 This is not the correct way to create a rotation animation. Correct way: Code: Dim x As B4XView = YourView x.SetRotationAnimated(18000, 360) Upvote 0
This is not the correct way to create a rotation animation. Correct way: Code: Dim x As B4XView = YourView x.SetRotationAnimated(18000, 360)