ContentResolver.applyBatch是否在单独的线程上运行

时间:2013-07-30 10:29:19

标签: android android-sqlite android-contentresolver

我需要记录联系人表格中更新所需的时间。如果我为上面提到的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));

输出为diff @ 0。但实际上大约需要15-20秒来更新大约150条记录。

它是在单独的线程上运行吗? 如何记录更新表中记录所需的时间?

1 个答案:

答案 0 :(得分:0)

使用System.currentTimeMillis();

相关问题