RGSS2 stores it's frame count, you can do something like this:
CODE
@count_start = Graphics.frame_count
while @count_start < @limit
$game_variables[<insert variable number here>] = Graphiccs.frame_count - @count_start
end
@count_start gets the graphic's current frame (say 20)
@limit is how high you want it to go (say 10)
$game_variables[] is the variable you want to increment
so, every time you go through the while, the variable is being set to the difference of Graphics.frame_count - @count_start. after @count_start reaches 10 (10 frames later) it will stop incrementing said variable.
EDIT - to do it by hours, you'd do something like:
CODE
@count_start = Graphics.frame_count
while @count_start < @limit
$game_variables[<insert variable number here>] = (((Graphiccs.frame_count - @count_start) / Graphics.frame_rate) / 60 / 60).truncate
end