Skip to content

Instantly share code, notes, and snippets.

@JokerMartini
Created October 22, 2015 18:31
Show Gist options
  • Save JokerMartini/9d7442648000008c4080 to your computer and use it in GitHub Desktop.
Save JokerMartini/9d7442648000008c4080 to your computer and use it in GitHub Desktop.
Maxscript: This snippet demonstrates how to timestamp memory and execution time.
--Info Logging Start
clearlistener()
RunStartTime = (timestamp())
RunStartMemory = heapfree
-- Function goes here
--Info Logging End
RunEndTime = (timestamp())
RunEndMemory = heapfree
RunMemoryUsed = RunStartMemory - RunEndMemory
RunTimeLength = ((dotnetclass "TimeSpan").FromMilliseconds (RunEndTime - RunStartTime)).ToString()
Format "\n-----------------------------------------------------------"
Format "\nMemory Used:\t%\n" RunMemoryUsed
Format "Process Time:\t%\n" RunTimeLength
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment