Created
January 7, 2019 11:57
-
-
Save zbounik/3b1b880dc73e8a4e93bbe62f787c2cc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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