Batch Processing

Hello all,
I am trying to import a massive amount of data, and as far as I search, I should use batch processing to lower the time to upload. But I cannot find any example code about it, like how can I implement this process in my code?