Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 having an uproarious good time at the Monastery: (11)
As of 2014-11-26 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (166 votes), past polls