clock
Definition
-- @/=[C]:-1
function clock(...)
Callers
@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua
local startTime = os.clock()
local elapsed = os.clock() - startTime
log('I', logTag, string.format('Generated buffer with %d circles in %.3fs', #self.bufferPoints, elapsed))
@/lua/ge/extensions/scenario/raceMarkers/overhead.lua
self.arrow.instanceColor1 = ColorF(1,1,1,self.currentColor.a):asLinear4F()
self.arrow:setPosition(vec3(0,0,0.4 + math.sin(os.clock()*1.9)*0.4)+self.pos)
-- self.arrow:setField('instanceColor', 1, ""..self.currentColor.r.." "..self.currentColor.g.." "..self.currentColor.b.." "..self.currentColor.a)
@/lua/ge/extensions/editor/gen/terrain.lua
U.dump(aregion, '?? roadPlace_areg:')
local outputFile = io.open('./tmp/reg_save_'..tostring(os.clock())..'.json', "w")
lo('??^^^^^^^^^^^^^^^^ if_FILE:'..tostring(outputFile))
-- if true then return end
local now = os.clock()
if not ctime then
@/lua/ge/extensions/scenario/raceMarkers/attention.lua
self.left.instanceColor1 = ColorF(0,0,0,self.currentColor.a):asLinear4F()
self.left:setPosition( vec3(0,0,math.sin(os.clock()*3)*(0.2*self.scale.x/1.5))+self.pos+tmpVec)
-- self.left:setField('instanceColor', 1, ""..self.currentColor.r.." "..self.currentColor.g.." "..self.currentColor.b.." "..self.currentColor.a)
@/lua/ge/extensions/editor/gen/exp_frame.lua
local ctime = os.clock()
local groupEdit
local ttime = os.clock()
-- lo('?? tt:'..tostring(cmove))
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
om.canSave = false
om:registerObject(val) --'tmp_'..tostring(os.clock()))
scenetree.findObject('edit'):add(om.obj)
@/lua/ge/extensions/editor/gen/test.lua
lo('?? for_DAE:'..tostring(om.obj)) --..':'..om.__parent)
om:registerObject(nm) --'tmp_'..tostring(os.clock()))
groupBat:add(om.obj)
-- local t = os.execute("echo 'test'")
lo('?? test:'..command..':'..tostring(os.clock()))
]]
@/lua/ge/extensions/util/screenshotCreator.lua
local function yieldSec(yieldfn,sec)
local start = os.clock()
while (start+sec)>os.clock() do
local start = os.clock()
while (start+sec)>os.clock() do
yieldfn()
@/lua/vehicle/bdebugImpl.lua
local function debugDraw(focusPos)
-- local currTime = os.clock()
-- local dt = currTime - lastTime
if type(v) ~= "table" and v ~= M.initState.vehicle[k] and M.state.vehicleDebugVisible then
--lastTime = os.clock()
M.debugDraw = debugDraw
@/lua/ge/extensions/flowgraph/nodes/environment/randomTimeOfDay.lua
{ dir = 'in', type = 'number', name = 'toHour', default = 17, hardcoded = true, description = "Ending hour (0-23)." },
{ dir = 'in', type = 'bool', name = 'use24Hour', default = false, hardcoded = true, description = "If true, formats time as 24-hour clock (HH:MM). If false, formats as 12-hour clock with AM/PM." },
{ dir = 'out', type = 'number', name = 'time', description = "Time of day on a scale from 0 to 1. 0.5 is midnight." },
@/lua/ge/extensions/core/settings/settings.lua
end
lastSavedTime = os.clock()
alreadySaving = true
for _,v in pairs(files) do
if (v.filename == M.impl.pathLocal or v.filename == M.impl.pathCloud) and (os.clock()-lastSavedTime) > 5 then
settingFileChanged = true
@/lua/ge/extensions/scenario/raceMarkers/crawlMarker.lua
local currentTime = os.clock()
self.delay = self.delay - dtSim
@/lua/ge/extensions/editor/gen/decal.lua
if veh then
local ctime = os.clock()
if not car.time or ctime - car.time > 0.1 then --0.02 then
@/lua/ge/extensions/flowgraph/nodes/recording/recordCamera.lua
self.path = {}
self.startTime = os.clock()
end
if self.pinIn.snap.value then
table.insert(self.path, { time = os.clock() - self.startTime, pos = self.pinIn.pos.value, rot = self.pinIn.rot.value})
end
@/lua/vehicle/extensions/tech/platooning.lua
local mode
local lastUpdateTime = os.clock() -- Initialize the last update time
local lastUpdate = os.clock()
local lastUpdateTime = os.clock() -- Initialize the last update time
local lastUpdate = os.clock()
local timeToPrint = false
-- Calculate the time elapsed since the last update
local currentTime = os.clock()
local deltaTime = currentTime - (lastUpdateTime or currentTime)
local function MPC(mode, encodedDistances, targetSpeedIn, inputSpeed, vehicleID, dtSim, debug)
local currentTime = os.clock()
@/lua/ge/extensions/editor/masterSpline.lua
if selSpline.isOptimising then -- If optimising, pulse the colour of the button to indicate that it is executing.
local t = os.clock() * pulseFreq
local s = 0.5 + 0.5 * sin(6.283185307179586 * t)
@/lua/ge/extensions/core/hotlapping.lua
local function start()
startTime = os.clock() * 1000
currentCP = 1
if pausedStart == 0 then
pausedStart = os.clock() * 1000
guihooks.trigger("HotlappingTimerPause")
end
currentPauseTime = os.clock() * 1000 - pausedStart
end
if not useScenarioTimer or not scenario_scenarios.getScenario().timer then
totalTime = (os.clock()*1000 - startTime) - totalPauseTime
else
lastRealMillis = os.clock()*1000
end
local function passTimeToGUI()
local dt = os.clock()*1000 - lastRealMillis
local info = M.getTimeInfo()
@/lua/ge/extensions/editor/gen/world.lua
inselect = false,
ctime = os.clock(),
ccommand = '',
om.canSave = false
om:registerObject('tmp_'..tostring(os.clock()))
local id = om:getID()
local ctime = os.clock()
if U._PRD == 0 and out.ccommand and ctime and out.ctime and (ctime - out.ctime) > 2 then
out.ctime = ctime
-- lo('?? test:'..command..':'..tostring(os.clock()))
end
if not dpos[id] then dpos[id] = {} end
om:registerObject(nm) --'tmp_'..tostring(os.clock()))
lo('?? for_DAE:'..tostring(om.obj)..':'..nm..':'..id) --..':'..om.__parent)
-- lo('?? for_DAE:'..tostring(om.obj)) --..':'..om.__parent)
om:registerObject(nm) --'tmp_'..tostring(os.clock()))
groupEdit:add(om.obj)
-- lo('?? for_DAE:'..tostring(om.obj)) --..':'..om.__parent)
om:registerObject(nm) --'tmp_'..tostring(os.clock()))
groupBat:add(om.obj)
@/lua/ge/extensions/ui/apps/minimap/vehicles.lua
if policeCars[otherVId] then
vehColor = color(math.sin(os.clock()*5 + otherVId*0.01 )*128+128, 0, math.sin(os.clock()*5+math.pi+otherVId*0.01)*128+128, 255)
vehLayer = layers.VEHICLES_POLICE
if policeCars[otherVId] then
vehColor = color(math.sin(os.clock()*5 + otherVId*0.01 )*128+128, 0, math.sin(os.clock()*5+math.pi+otherVId*0.01)*128+128, 255)
vehLayer = layers.VEHICLES_POLICE
@/lua/common/libs/resty/template/microbenchmark.lua
local x = clock()
for _ = 1, iterations do
end
local z = clock() - x
print(format(" Parsing Time: %.6f", z))
x = clock()
for _ = 1, iterations do
end
z = clock() - x
print(format("Compilation Time: %.6f (template)", z))
x = clock()
for _ = 1, iterations do
end
z = clock() - x
print(format("Compilation Time: %.6f (template, cached)", z))
x = clock()
for _ = 1, iterations do
end
z = clock() - x
print(format(" Execution Time: %.6f (same template)", z))
x = clock()
for _ = 1, iterations do
end
z = clock() - x
print(format(" Execution Time: %.6f (same template, cached)", z))
x = clock()
for i = 1, iterations do
end
z = clock() - x
print(format(" Execution Time: %.6f (different template)", z))
x = clock()
for i = 1, iterations do
end
z = clock() - x
print(format(" Execution Time: %.6f (different template, cached)", z))
x = clock()
for i = 1, iterations do
end
z = clock() - x
print(format(" Execution Time: %.6f (different template, different context)", z))
x = clock()
for i = 1, iterations do
end
z = clock() - x
print(format(" Execution Time: %.6f (different template, different context, cached)", z))
@/lua/ge/extensions/freeroam/bigMapMode.lua
iconInfo.worldPosition = playerVehicle:getPosition()
iconInfo.customSizeFactor = 0.8 + math.sin(os.clock()*4)*0.1
@/gameplay/missionTypes/hypermiling/fluidConsumptionToGraph.lua
local now = os.clock()
if not fuelData then
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalPath.lua
local distance = 0
distance = os.clock() * speed % spacing
local pathCount = #path
@/lua/ge/extensions/core/cameraModes/unicycle.lua
-- user just started pressing a button or analog stick
self.lastSnapTurn = os.clock()
mustTurn = true
-- user has switched direction of button or analog stick
self.lastSnapTurn = os.clock()
mustTurn = true
local snapTurnPeriod = 0.4
if os.clock()-self.lastSnapTurn > snapTurnPeriod then
self.lastSnapTurn = self.lastSnapTurn + snapTurnPeriod
@/lua/ge/extensions/util/maptiles.lua
adjustRenderingSettings() -- Adjust rendering settings before starting
startTime = os.clock() -- Record start time
if not show3DWorld[0] then
local totalTiles = (#tilePositions) * (maxZoomLevel + 1)
local elapsedTime = os.clock() - startTime
local averageTimePerTile = elapsedTime / tilesDone
@/lua/vehicle/extensions/tech/ACC.lua
local mode
local lastUpdateTime = os.clock() -- Initialize the last update time
local maintainSpeedFlag = false
-- Calculate the time elapsed since the last update
local currentTime = os.clock()
local deltaTime = currentTime - (lastUpdateTime or currentTime)
local targetSpeedIn = math.floor(targetSpeedIn * 10) / 10
local currentTime = os.clock()
@/lua/ge/extensions/editor/flowgraph/main.lua
if self.mgr.transient then
gridColor = im.ImVec4(math.sin(os.clock()*3)*0.25+0.75,0.25,0.25,1)
end
if #duplicateIds > 0 then
im.PushStyleColor2(im.Col_Button, im.ImVec4((os.clock()*3)%1,0,0,1))
if im.Button("Duplicate id!!: " ..#duplicateIds) then
im.SetCursorPos(im.ImVec2(50/vz[0]-im.GetWindowPos().x+vp.x / vz[0], 5/vz[0]-im.GetWindowPos().y+vp.y / vz[0]))
--editor.uiIconImage(editor.icons.goat, im.ImVec2(300/vz[0],300/vz[0]), im.ImVec4(math.sin(os.clock()*3)*0.25+0.75,0.25,0.25,1))
--im.SetCursorPos(oldCp)
@/lua/ge/extensions/editor/toolUtilities/render.lua
local baseScale = style.sphereBar + style.barGlowScale
local t = os.clock() * style.highlightHoverPulseHz
local s = 0.5 + 0.5 * sin(6.283185307179586 * t)
local baseScale = style.sphereNodeHover
local t = os.clock() * style.highlightHoverPulseHz
local s = 0.5 + 0.5 * sin(6.283185307179586 * t)
local baseScale = style.sphereNodeHover
local t = os.clock() * style.highlightPulseHz
local s = 0.5 + 0.5 * sin(6.283185307179586 * t)
local baseScale = style.bigNode
local t = os.clock() * style.highlightPulseHz
local s = 0.5 + 0.5 * sin(6.283185307179586 * t)
local baseScale = style.sphereNode
local t = os.clock() * style.highlightHoverPulseHz
local s = 0.5 + 0.5 * sin(6.283185307179586 * t)
local function drawJoinLine(p0, p1)
local t = os.clock() * style.loopPulseHz
local s = 0.5 + 0.5 * sin(6.283185307179586 * t)