Another way to check op.

It checks all user that has @op in the channel every 5 secs then write it to file.
When you type !optime user, it will inform you the time user has spent as an op.

It works for multi channel, !optime is per channel basis.

Code:
on *:join:#:if !$timer($+(opcheck.,#))  { $+(.timeropcheck.,#) 0 5 opcheck # }
on *:text:!optime *:#:if $nick isop # { optime # $iif($2,$2,$nick) 1 }

alias -l opcheck {
  if $me !ison $1 { $+(.timeropcheck.,$1) off | return }
  var %i 1
  while $nick($1,%i,o) { 
    optime $1 $v1 
    inc %i 
  }
}

alias -l optime {
    if $isfile(opfile.ini) { var %d $iif($readini(opfile.ini,$+(optime.,$1),$2),$v1,0) }
    else { var %d 0 }
    if $3 { msg $1 $2 has $iif(%d,spent $duration(%d) as an op.,no online record.) } 
    else { writeini opfile.ini $+(optime.,$1) $2 $calc(%d + 5) }
    return
}


- untested.