Allah knows who will freely undertake righteous actions and who will choose evil actions. He also knows who will enter Paradise and who will enter Hell.
A person's act becomes manifest in earthly time, but its occurrence does not give Allah a new fact to learn. These acts are already within His knowledge.