Skip to content

Instantly share code, notes, and snippets.

@zbounik
Created January 7, 2019 11:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zbounik/3b1b880dc73e8a4e93bbe62f787c2cc5 to your computer and use it in GitHub Desktop.
Save zbounik/3b1b880dc73e8a4e93bbe62f787c2cc5 to your computer and use it in GitHub Desktop.
import Sofa
#import numpy as np
#import os
#import os
#from time import gmtime, strftime
import time
#from datetime import datetime
############## to count the simulation time
class controller(Sofa.PythonScriptController):
def initGraph(self, node):
self.rootNode = node
self.totalTime = 0
def onBeginAnimationStep(self,dt):
start=time.time()
#start = time.time()
self.totalTime+=dt
#########################
return start
def onEndAnimationStep(self, dt):
end =time.time()
start=self.onBeginAnimationStep(dt)
print(end-start)
return (end-start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment