Both are possible. The first suggests that you saw the whole process, while in the second one you might have just walked by and noticed him writing for a moment.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.