os.difftime

From GMod Wiki

Jump to: navigation, search
Function
Syntax os.difftime( Number t1, Number t2 )
Where is this used?
Description:
Returns the number of seconds from time t1 to time t2.
Returns: Number
Part of Library: os
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Os.difftime]Os.difftime [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionGetting a number of seconds passed from
Used onNewerShared.png
Code
print("From 60 seconds until 130 is " .. os.difftime(60, 130) .. " seconds")
OutputFrom 60 seconds until 130 is -70 seconds. Yes, that function returned exactly -70, i have no idea why. Test it yourself.


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox