How to save a number (seconds) in debug file?

Asked by shaihulud

Hi, i want to time how long it takes for several user scenarios to execute and print it into a seperate debug file. In short this is what i tried:

Debug.setUserLogFile("C:\\Users....TestRepport.txt")

start = time.time()
#test
stop = time.time()
elapsed = stop - start

Debug.user(elapsed)

However the Debug.user(elapsed) does not work and the this message follows:
[error] TypeError ( user(): 1st arg can't be coerced to )

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

the log messages are built according to
"some message containing place holders according to Java::String.format", var1, var2, var3, …

or you build a string your own:
Debug.user("my text %d"%(elapsed))

according to the Python ""%() feature (similar to Java::String.format

Revision history for this message
shaihulud (cal-a) said :
#2

Thanks RaiMan, that solved my question.