Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: How can I reduce the time taken by wav file to save in /tmp folder

by srikanth (Initiate)
on Dec 04, 2021 at 08:52 UTC ( [id://11139382]=note: print w/replies, xml ) Need Help??


in reply to Re: How can I reduce the time taken by wav file to save in /tmp folder
in thread How can I reduce the time taken by wav file to save in /tmp folder

print "RECORD FILE $tmpname wav \"$intkey\" \"$abs_timeout\" $beep \"$silence\"\n"; this is the line which is taking time to create file
  • Comment on Re^2: How can I reduce the time taken by wav file to save in /tmp folder
  • Download Code

Replies are listed 'Best First'.
Re^3: How can I reduce the time taken by wav file to save in /tmp folder
by Corion (Patriarch) on Dec 04, 2021 at 09:13 UTC

    I would think this takes time to create because it is writing the file while recording. If you record 60 seconds, the file will take 60 seconds to create.

    Do you expect something different?

      if that is the case then it should be same for every file it creates but it is not happening in that way. For every 20 files (approximately) it creates, 1 file it is taking time to create.
Re^3: How can I reduce the time taken by wav file to save in /tmp folder
by Marshall (Canon) on Dec 07, 2021 at 16:06 UTC
    That just looks like a print statement to me. I don't see anything that should "take time". STDOUT is buffered. Buffering can cause a delay in writing to the screen and make it look like something took a long time when in fact it didn't. Add this line: $|=1; at the top of your Perl code. That will turn off buffering.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139382]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-23 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found