exporting all vertices using a function

Hello,
I am writing a script which needs to get all the vertices of a geometry.
This action can be done by writing a loop using a myGeometry.getVertex(i).
This loop takes 5 seconds when the mesh has 350,000 vertices.
Is there a function like myGeometry.getVertices() which would be able to transfer all the vertices in only one function and which would make this action faster.
I thank you for your replies.