clockhp
Definition
-- @/=[C]:-1
function clockhp(...)
Callers
@/lua/common/extensions/tech/techCapture.lua
local lastFlush = os.clockhp()
-- log('D', logTag, 'Handling request: ', requestData)
local clock = os.clockhp()
local json = jsonEncode(requestData)
log('D', logTag, 'Handling response [' .. response.type .. '].')
local clock = os.clockhp()
response = convertBinaryDataToString(response)
@/lua/ge/extensions/core/input/virtualInput.lua
if not mgr then return end
mgr:emitEvent('vinput', deviceInstance, objType, objectInstance, action, val, os.clockhp())
end
@/lua/ge/extensions/telemetry/core.lua
event.t = os.clockhp()
@/lua/ge/extensions/gameplay/rally/util.lua
-- os.clockhp appears to be beamng-specific.
return os.clockhp()
end
@/lua/ge/extensions/gameplay/markers/bigmapMarker.lua
local extraHeight = career_modules_linearTutorial and career_modules_linearTutorial.bounceBigmapIcons and bounce((os.clockhp() * 0.9)%1) * 0.05 or 0
self.selected = self.cluster.containedIdsLookup[freeroam_bigMapMode.selectedPoiId]
@/lua/common/utils.lua
function timeprobeStart()
rawset(_G, '__prevtime__', os.clockhp())
end
if not __prevtime__ then
rawset(_G, '__prevtime__', os.clockhp())
else
else
local t = os.clockhp() - __prevtime__
if not omitPrint then
@/lua/ge/extensions/tech/capturePlayer.lua
local ctx, captureTimestamp
local lastRealTimestamp = os.clockhp()
local lastCaptureTimestamp = nil
captureTimestamp = tonumber(line)
local realTimestamp = os.clockhp()
@/lua/ge/extensions/util/stepHandler.lua
local function taskWaitStep(step)
if os.clockhp() - step._startingTime > step.duration then
step.complete = true
while stepToHandle do
if not stepToHandle._startingTime then stepToHandle._startingTime = os.clockhp() end
dtTable.dtReal = dtReal
stepToHandle.processTask(stepToHandle, dtTable)
if os.clockhp() - stepToHandle._startingTime > (stepToHandle.timeout or 120) then
local descriptor = string.format("%s: %s", stepToHandle.name or "Unknown Step", stepToHandle.origin or "Unknown Step")
local descriptor = string.format("%s: %s", stepToHandle.name or "Unknown Step", stepToHandle.origin or "Unknown Step")
log("I", logTag, string.format("Completed Step %0.2f: %s ", os.clockhp(), descriptor))
taskData.currentStep = taskData.currentStep + 1
@/gameplay/missionTypes/collection/customNodes/collectionMarkersNode.lua
if markerObj then
pos = pos + (vec3(0,0,math.sin(os.clockhp()*1.5) * 0.15+1.15))
markerObj:setPosition(pos)
local rot = quatFromEuler(0,0,(os.clockhp()*1.34567 + (1-(1-m.collectedTimer)*(1-m.collectedTimer))*math.pi*3)):toTorqueQuat()
markerObj:setField('rotation', 0, rot.x .. ' ' .. rot.y .. ' ' .. rot.z .. ' ' .. rot.w)
@/lua/vehicle/ve_utils.lua
function HighPerfTimer()
return setmetatable({os.clockhp()}, _HighPerfTimer)
end
function _HighPerfTimer:reset()
self[1] = os.clockhp()
end
function _HighPerfTimer:stop()
return (os.clockhp() - self[1]) * 1000
end
function _HighPerfTimer:stopAndReset()
local t = (os.clockhp() - self[1]) * 1000
self[1] = os.clockhp()
local t = (os.clockhp() - self[1]) * 1000
self[1] = os.clockhp()
return t
function _HighPerfTimer:getTime()
return os.clockhp() * 1000
end
@/lua/ge/extensions/gameplay/markers/inspectVehicleMarker.lua
self.iconOff:normalize()
self.iconOff:setScaled(bounce((os.clockhp() * 0.9)%1) * 0.4 * linearScale(distance, nearDist, nearDist +3, 1, 0))
self.iconPos:setAdd(self.iconOff)
@/lua/ge/extensions/core/vehicle/partmgmt.lua
local function sendDataToUI()
local startTime = os.clockhp()
local playerVehID = be:getPlayerVehicleID(0)
log('D', 'partmgmt', 'sendDataToUI took ' .. (os.clockhp() - startTime) .. ' seconds')
end
partsSelectorChangedState = state
partsSelectorChangedTime = os.clockhp()
end
if partsSelectorChangedTime then
if os.clockhp() - partsSelectorChangedTime > 0.1 then
partsSelectorChangedDebounced(partsSelectorChangedState)
@/lua/ge/extensions/core/input/actions.lua
local function triggerDown(actionName)
ActionMap.triggerBindingByNameDigital(actionName, true, os.clockhp())
end
local function triggerUp(actionName)
ActionMap.triggerBindingByNameDigital(actionName, false, os.clockhp())
end
@/lua/ge/extensions/flowgraph/nodes/util/time.lua
function C:work()
self.pinOut.time.value = os.clockhp()
self.pinOut.dtReal.value = self.mgr.dtReal
@/lua/vehicle/controller/tech/cosimulationCoupling.lua
local cycleTime = 0.0 -- The cycle time. This is the most-recently measured time between two send operations, in seconds.
local lastTimeOfSend = os.clockhp() -- The time at which the last message was sent from Lua to Simulink.
local function addToCSV(msgOut)
cycleTime = os.clockhp() - lastTimeOfSend
lastTimeOfSend = os.clockhp()
cycleTime = os.clockhp() - lastTimeOfSend
lastTimeOfSend = os.clockhp()
csvSendData:add(os.clockhp(), unpack(msgOut))
lastTimeOfSend = os.clockhp()
csvSendData:add(os.clockhp(), unpack(msgOut))
end
if enableVSL then
csvReceiveData:add(os.clockhp(), unpack(msgIn))
end
if enableVSL then
csvReceiveData:add(os.clockhp(), unpack(msgIn))
end
end
cycleTime = os.clockhp() - lastTimeOfSend
lastTimeOfSend = os.clockhp()
cycleTime = os.clockhp() - lastTimeOfSend
lastTimeOfSend = os.clockhp()
-- Add to CSV for logging
csvSendData:add(os.clockhp(), unpack(msgOut))
-- log('I', logTag, 'VSL only from controller, logging data.')
@/lua/ge/extensions/remoteControl/remoteControl.lua
buttonState = not buttonState
vim:emitEvent('vinput', deviceInst, "button", 0, "change", buttonState and 1 or 0, os.clockhp())
return {}
if vim then
vim:emitEvent('vinput', deviceInst, "axis", 0, "change", (math.sin(timer) + 1) / 2, os.clockhp())
else
vim:emitEvent('vinput', deviceInst, "button", 0, "down", 1, os.clockhp())
vim:emitEvent('vinput', deviceInst, "button", 0, "up", 1, os.clockhp())
vim:emitEvent('vinput', deviceInst, "button", 0, "down", 1, os.clockhp())
vim:emitEvent('vinput', deviceInst, "button", 0, "up", 1, os.clockhp())
vim:emitEvent('vinput', deviceInst, "axis", 0, "change", 0.5, os.clockhp())
vim:emitEvent('vinput', deviceInst, "button", 0, "up", 1, os.clockhp())
vim:emitEvent('vinput', deviceInst, "axis", 0, "change", 0.5, os.clockhp())
end
@/lua/vehicle/controller/tech/vehicleSystemsCoupling.lua
if debugFile then
csvSendData:add(os.clockhp(), unpack(messageToSimulink))
end
if debugFile then
csvReceiveData:add(os.clockhp(), unpack(decodedMessageFromSimulink))
end
if debugFile then
csvPhysicsSteps:add(os.clockhp())
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/trackStageTime.lua
function C:work(args)
local stageTime = os.clockhp()
@/lua/vehicle/hydros.lua
local function virtualSendForceFeedback(o, FFBID, torque, dampCoef, inertia, friction)
local t = clockhp()
local dt = max(t - virtualWheelT, 0)
-- drivers will struggle if sending too many updates per wall clock second, so we throttle them here (according to FFBperiod)
local now = clockhp() -- important, this must be wall clock time, not sim time (steering wheel drivers don't care about sim time)
if now > nextDriverUpdate then
local function vibrationUpdate(dt)
local now = clockhp() -- important, this must be wall clock time, not sim time (gamepad drivers don't care about sim time)
timeSinceLastVibrationUpdate = timeSinceLastVibrationUpdate + dt
turnOffFFBInterfaces()
nextDriverUpdate = clockhp() + FFBperiod
else
@/lua/ge/extensions/core/vehicleTriggers.lua
end
local triggerdBindingCount = ActionMap.triggerBindingByNameDigital(lnk.inputAction, actionValue > 0.9, os.clockhp(), vehicleId)
if debugUIEnabled then
@/lua/ge/extensions/gameplay/markers/parkingMarker.lua
self.iconOff:normalize()
self.iconOff:setScaled(bounce((os.clockhp() * 0.9)%1) * 0.4 * linearScale(distance, nearDist, nearDist +3, 1, 0))
self.iconPos:setAdd(self.iconOff)
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalSingle.lua
for i = 1, 4 do
clr[i] = lerp(self.pinIn.clrA.value[i], self.pinIn.clrB.value[i], pingpong(os.clockhp() * self.pinIn.clrFrequency.value, 1))
end