Pulse Works Studio

Parse Error: Static function "get_ticks_msec()" not found in base "OS".

OS.get_ticks_msec() moved to Time. The OS class has no method by that name.

Cause

Godot 4 gathered clock and timer calls on the Time singleton. OS is still a real class, which is why the message says the static function is missing on that base rather than that OS itself is unknown.

Fix

func elapsed_ms(started: int) -> int:
	return Time.get_ticks_msec() - started

func _ready() -> void:
	var started := Time.get_ticks_msec()
	await get_tree().process_frame
	print(elapsed_ms(started))

Related

Godot Dev Tools is a Pulse Works Studio project. All error explainers.