0

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?

4

1 回答 1

0

使用 System.currentTimeMillis();

于 2013-07-30T10:44:38.483 回答