The old clock kept ticking on the mantelpiece, as if counting the seconds left before the coming of daylight.
as if counting - is Participle I as we have here Adverbial Modifier of comparison.
I have taken this from a book for English Teachers.
"Adjectival and adverbial characteristics of the participle are seen in their syntactical functions. Both Participle I and Participle II may function as an attribute or adverbial modifiers.
e.g. I looked at the flying plane.
The frozen ground was as hard as stone.
Entering the room, she greeted everybody.
Accompanied by her mother, Ann entered the hall."
So, my question is how can I understand whether I deal with the gerund or Participle I?