This tool uses the method GetLiveLatchesProfiler from KMO.

Every each X seconds (you can configure this value), Kankuru executes a query and gets statistics from sys.dm_os_latch_stats.
Kankuru keeps in memory the result of the first execution and is able to calculate a diff between the 2 datasets.

KMO knows the definition of some latches. You can add new wait definition in this class.