Jump to content
Sign in to follow this  
hoknamahn

How to get a system time in HScript?

Recommended Posts

Hi guys!

I have one question: how i can get system time from HScript? I want to get start time and end time of any animation and calculate average fps of system.

I thought what backward quotes must work in Houdini like in Perl but it's not working (at least in the Windows)! :( (see below)

set start_time = `system(time /T)`;

Who can answer on question: how to get system time and assign it to variable? :-(

Share this post


Link to post
Share on other sites

Hey there,

How about starting hscript with '-v' which will print out time stamps for each frame rendered? B)

Cheers!

steven

Share this post


Link to post
Share on other sites

the unix command from hscript lets you run shell commands, for example

unix date

would work but houdini isn't aware of whatever the date command outputs.

still you can do a

unix "echo %TIME% > c:/temp/start_time.txt"

play the animation, blah blah then

unix "echo %TIME% > c:/temp/stop_time.txt"

or append with >>

(the double quotes are there to prevent hscript from interpreting anything inside them, well i think variable expansion would happen)

do the rest in perl and call it again using the unix command like

unix perl blah.pl

hum well i'm sure there are 10^6 better ways to do it

Share this post


Link to post
Share on other sites

YYMMDD format
 

`substr(system("cmd /C date /T"), 12, 2)``substr(system("cmd /C date /T"), 4, 2)``substr(system("cmd /C date /T"), 7, 2)`

 

Share this post


Link to post
Share on other sites
On 8/22/2020 at 4:45 AM, hved said:

YYMMDD format
 


`substr(system("cmd /C date /T"), 12, 2)``substr(system("cmd /C date /T"), 4, 2)``substr(system("cmd /C date /T"), 7, 2)`

 

Better late than never :lol:

  • Haha 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×