I need to record the time taken for an update in the contacts table. If I run the following code for the above mentioned ContentResolver.applyBatch
,
Calendar c = Calendar.getInstance();
int seconds = c.get(Calendar.SECOND);
act.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
int seconds1 = c.get(Calendar.SECOND);
Log.d(TAG, "diff @ "+(seconds1-seconds));
The output is diff @ 0
. But it actually takes around 15-20 seconds for an update of around 150 records.
Does it run on a separate thread? How can I record the time taken for the update of a record in the table?