Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2015-10-09 14:56 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (242 votes), past polls