Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The scripts you’ve seen so far typically involve taking a DMV snapshot of relevant metrics, doing some work (for example, running a query or waiting a given time interval), and then taking another DMV snapshot. Finally, you compare the two DMV snapshots to determine what effect the query or time interval has on the DMV delta.
With DMV data in general, and performance counters in particular (especially the per-second ones), it can prove instructive to record the DMV metrics on a more regular basis. The script you can use to record DMV snapshots periodically is given here.