1. A method performed by an application program interface (API), the method comprising: reading a count value from a hardware counter in a network device; resetting the hardware counter; updating a software counter with the count value, said software counter being stored in a memory location in a memory, said memory location being associated with the hardware counter, and said memory being accessible by at least one of the API and an application program using the API; reading a plurality of additional count values from a plurality of additional hardware counters; resetting the plurality of additional hardware counters; updating a plurality of additional software counters with the plurality of additional count values, said plurality of additional software counters being stored in a plurality of additional memory locations in the memory, at least one of said additional memory locations being associated with a respective one of the plurality of additional hardware counters; and receiving a function command from the application program prior to reading the count value or the plurality of additional count values, said function command to identify the hardware counter and the plurality of additional hardware counters from among a plurality of hardware counters and to initiate the reading, resetting, and updating, wherein each of the plurality of hardware counters is individually identified by a mask index, and wherein the application program provides a single index value to identify the hardware counter and the plurality of additional hardware counters by performing a logical CR operation on respective mask indices for the hardware counter and the plurality of additional hardware counters.