2025-07-20 02:48 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004025Spring engineGeneralpublic2013-10-08 12:52
Reportersilentwings 
Assigned ToKloot 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionduplicate 
Product Version94.1 
Target VersionFixed in Version 
Summary0004025: Spring.DIffTimers always returns 0
DescriptionSee the code below, which should compare the timer in every drawframe to the timer from the previous gameframe - it spams only 0s to the screen.
Steps To Reproducefunction widget:GetInfo()
  return {
    name = "Timer Test",
    desc = "",
    author = "TFC",
    date = "Oct 05, 2013",
    license = "MIT",
    layer = -9000,
    enabled = true
  }
end
 
local othertimer
 
function widget:GameFrame(n)
        if n == 30 then
                othertimer = Spring.GetTimer()
        end
end
 
 
function widget:DrawScreen()
        if (othertimer) then
                local t = Spring.GetTimer()
                Spring.Echo(Spring.DiffTimers(t, othertimer))
        end
end
 
Additional Informationpresumably its related to http://springrts.com/mantis/view.php?id=3845
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
related to 0003845resolvedKloot Partial (possibly graphical) lag when playing 
related to 0004040resolvedKloot test.lua broken / Spring.GetTimer() (?) 
+Relationships

-Notes

~0011685

silentwings (reporter)

Last edited: 2013-10-05 22:58

View 2 revisions

tested with 94.1.1+1241 and ba-svn + ba chickens
(because this bug breaks a part of chickens)

opps - i set the wrong version above

~0011689

Kloot (developer)

worksforme but it points directly to chrono::high_resolution_clock failing

spring_gettime() -->
spring_time::gettime() -->
spring_time_native(Cpp11Clock::Get()) -->
chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count()
+Notes

-Issue History
Date Modified Username Field Change
2013-10-05 22:53 silentwings New Issue
2013-10-05 22:57 silentwings Note Added: 0011685
2013-10-05 22:58 silentwings Note Edited: 0011685 View Revisions
2013-10-05 23:57 Kloot Note Added: 0011689
2013-10-06 00:07 Kloot Relationship added related to 0003845
2013-10-06 02:21 Kloot Status new => closed
2013-10-06 02:21 Kloot Assigned To => Kloot
2013-10-06 02:21 Kloot Resolution open => duplicate
2013-10-08 12:52 Kloot Relationship added related to 0004040
+Issue History