I speak Spanish and my English is through the google translator, this is one of the user profiles that I use:
add address-pool=dhcp_pool0 keepalive-timeout=5s mac-cookie-timeout=4h name=2hours on-login=":local time 4h\r\
\n:local atime [ /system clock get time ]\r\
\n:local adate [ /system clock get date ]\r\
\n:local comment \"\$user conected: \$adate at: \$atime\"\r\
\n:local thours (\$atime + \$time)\r\
\n:if ([ /ip hotspot user get \$user comment ]=\"\") do={ [ /ip hotspot user set \$user comment=\$comment ] }\r\
\n\r\
\n[/system scheduler add name=\$user on-event=\"/ip hotspot user remove \\\"\$user\\\" \\r\\\r\
\n \\n/ip hotspot cookie remove [find user=\\\"\$user\\\"] \\r\\\r\
\n \\n/system scheduler remove [find name=\\\"\$user\\\"] \\r\\\r\
\n \\n\\r\\\r\
\n\" start-date=\$adate start-time=\$thours]\r\
\n" rate-limit=256k/1024k
users have 4 hours to spend the internet that I give them, which is two hours, since as you can see in the user profile I use what I call "PAUSED TIME", that is to say that if for some reason the user decides to leave the hotspot area before his 2 hours are up, when he returns I have the time in which he left, the problem is that if for some reason reason there is an electrc cut and it lasts more than four hours the user will lose his time, so he has not spent his 2 hours, I don't know if you understand me.
EL DONCITO.