Why is とき used with instantaneous verb 気づく?


> 気づいたときには たまっているもの  
>  You'll save [enough money] before you know it.

At least based on the dictionary definition and examples, 気づくseems to be an
instantaneous verb, "realize". How then does とき fit in this sentence? I
thought とき means while doing something.




The questions linked in the comment by @[Eddie
Kal](https://japanese.stackexchange.com/users/30454/), taken together, should
answer your question in depth.

In brief, とき literally means "time", and can be used to mean "time _while_
doing something", or "time _when_ something happens / happened / will happen".

In your sample sentence, we can break things down as follows:

  * 気【き】づいたときにはたまっているもの  
[気づいた]{noticed}[とき]{time when }[に]{at}[は]{ CONTRASTIVE }[たまっている]{ it is
accumulating / accumulated }[もの]{ REASON}  
_(literal)_ At the time you've noticed it, it will have been accumulated, is
the reason  
_(idiomatic)_ Because before you know it, it'll be saved up




The questions linked in the comment by @[Eddie
Kal](https://japanese.stackexchange.com/users/30454/), taken together, should
answer your question in depth.

In brief, とき literally means "time", and can be used to mean "time _while_
doing something", or "time _when_ something happens / happened / will happen".

In your sample sentence, we can break things down as follows:

  * 気【き】づいたときにはたまっているもの  
[気づいた]{noticed}[とき]{time when }[に]{at}[は]{ CONTRASTIVE }[たまっている]{ it is
accumulating / accumulated }[もの]{ REASON}  
_(literal)_ At the time you've noticed it, it will have been accumulated, is
the reason  
_(idiomatic)_ Because before you know it, it'll be saved up

