• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AU processor load
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AU processor load


  • Subject: Re: AU processor load
  • From: tahome izwah <email@hidden>
  • Date: Tue, 27 Jan 2009 10:18:31 -0700

Sure, that's easy. On entry of your callback (before doing any DSP) simply do:

	UnsignedWide start, end;
	Microseconds(&start);

------------------------------------------------------------------------------------------

DSP code goes here

------------------------------------------------------------------------------------------

	Microseconds(&end);

	double microsecondsForDsp = end.lo - start.lo;
	double microsecondsForBuffer = 1000000. * inNumberFrames / mSampleRate;

	double cpuLoadPercent = 100. * microsecondsForDsp / microsecondsForBuffer;

That's really all you need to do.

Hope this helps,
--th



2009/1/26 Ethan Funk <email@hidden>:
> Is there an easy way to track the processor load from with in a AU render
> callback?  I am NOT using AUGraphs in my application and am instead using
> the callbacks to connect AUs, but I still need a way to gauge how much of
> the total available processor(s) time I am spending in the render callback
> chain so I can report processor load to the user.
>
> Thanks,
> Ethan...
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: AU processor load
      • From: William Stewart <email@hidden>
References: 
 >AU processor load (From: Ethan Funk <email@hidden>)

  • Prev by Date: Re: AudioConverter gives non normalized samples?!
  • Next by Date: Re: ExtAudioFileRead and AudioBufferList, should I use something else?
  • Previous by thread: Re: AU processor load
  • Next by thread: Re: AU processor load
  • Index(es):
    • Date
    • Thread