Grammar basics
Past perfect continuous
Use the past perfect continuous for an action that was going on for some time before another action in the past.
Structure
| Sentence | Structure | Example |
|---|---|---|
| Positive | Subject + had + been + V-ing | I had been working for five hours when the server crashed. |
| Negative | Subject + had + not + been + V-ing | She hadn't been sleeping well. |
| Question | Had + subject + been + V-ing? | How long had you been waiting? |
When to use
How long an action went on before something happened
I had been waiting for an hour when the bus finally came.
To explain a past result
The ground was wet. It had been raining all night.
Learn to understand it first
This tense is not very common in everyday speech. You'll see it more in books and stories. It's the present perfect continuous, but moved into the past: have been → had been.
Time words
These words often go with the past perfect continuous.
How long
Use it to ask about the length of time.
How long had you been living there before you moved?
For hours
For a long time, for more than one hour.
I had been looking for the bug for hours before I found it.
All morning
During the whole morning. You can also say all day and all night.
I was tired because I had been coding all morning.