math.TimeFraction

From GMod Wiki

Jump to: navigation, search
Function
Syntax math.TimeFraction( Number Start, End, Current )
Where is this used?
Description:
Takes the start, end, and current times and calculates what fraction of the total time the current time is.
Returns: Number
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.TimeFraction]Math.TimeFraction [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionWhat the code does
Used onNewerShared.png
Code
function math.TimeFraction( Start, End, Current )
	return ( Current - Start ) / ( End - Start )
end
OutputA Fraction.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox