You haven’t mentioned what type of technology you want to bill exactly so I am going to have to make some assumptions. If I do make some wrong ones though please let me know and I will try to correct my advise………if necessary
With you mentioning usernames I am presuming it is some sort of virtual access technology like DSL or maybe even wi-fi you are dealing with. With anything like that a common way to do this is to use the radius accounting information and use the session start, stop and bit counters to determine session duration and volume of data transferred during a session.
There are a couple of good tools out there that can help, 1 is open source and the other is not. For open source have a look at Freeside.biz or for a more costly but supported option try Opti Gold by Digital Point.