Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Media Player - CPU Usage

by Lotus1 (Chaplain)
on Nov 28, 2012 at 22:03 UTC ( #1006113=note: print w/ replies, xml ) Need Help??


in reply to Media Player - CPU Usage

Here is what is shown for this in the synopsis for Win32::MediaPlayer.

while(1) { sleep 1; print 'Now Position: '.$winmm->pos(1)."\r"; # Show now tim +e. };

To break out of the while loop you could do this:

       last unless $winmm->pos < $winmm->length;

Update: In order to get the print statement inside the while loop to work I had to add $| = 1; at the top of the program.


Comment on Re: Media Player - CPU Usage
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-07 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls