You must call glUniform() to update "time" before each call to glDrawArrays(). IF that causes a null pointer exception, you probably need to call glUseProgram() first.
If "time" is to be calculated by the Vertex shader, you should change it to be a varying instead of a uniform.