[SPARK-34015][R] Fixing input timing in gapply
[SPARK-34015][R] Fixing input timing in gapply

### What changes were proposed in this pull request?

When sparkR is run at log level INFO, a summary of how the worker spent its time processing the partition is printed. There is a logic error where it is over-reporting the time inputting rows.

In detail: the variable inputElap in a wider context is used to mark the end of reading rows, but in the part changed here it was used as a local variable for measuring the beginning of compute time in a loop over the groups in the partition. Thus, the error is not observable if there is only one group per partition, which is what you get in unit tests.

For our application, here's what a log entry looks like before these changes were applied:

`20/10/09 04:08:58 INFO RRunner: Times: boot = 0.013 s, init = 0.005 s, broadcast = 0.000 s, read-input = 529.471 s, compute = 492.037 s, write-output = 0.020 s, total = 1021.546 s`

this indicates that we're spending more time reading rows than operating on the rows.

After these changes, it looks like this:

`20/12/15 06:43:29 INFO RRunner: Times: boot = 0.013 s, init = 0.010 s, broadcast = 0.000 s, read-input = 120.275 s, compute = 1680.161 s, write-output = 0.045 s, total = 1812.553 s
`
### Why are the changes needed?

Metrics shouldn't mislead?

### Does this PR introduce _any_ user-facing change?

Aside from no longer misleading, no

### How was this patch tested?

unit tests passed. Field test results seem plausible

Closes #31021 from WamBamBoozle/input_timing.

Authored-by: Tom.Howland <152ea837ead3d3fdfd45c0bf9c5b31014ef1a2e0@target.com>
Signed-off-by: HyukjinKwon <2680965ad5aae29275c8fb10150cb10f5554e78b@apache.org>

apache/spark,cloud-fan/spark,milliman/spark,ueshin/apache-spark,chuckchen/spark,srowen/spark,shaneknapp/spark,zero323/spark,srowen/spark,ueshin/apache-spark,gengliangwang/spark,zzcclp/spark,srowen/spark,maropu/spark,wangmiao1981/spark,dongjoon-hyun/spark,shaneknapp/spark,holdenk/spark,chuckchen/spark,gengliangwang/spark,vinodkc/spark,JoshRosen/spark,wangmiao1981/spark,jiangxb1987/spark,maropu/spark,milliman/spark,nchammas/spark,zzcclp/spark,dongjoon-hyun/spark,cloud-fan/spark,WeichenXu123/spark,JoshRosen/spark,rednaxelafx/apache-spark,cloud-fan/spark,zzcclp/spark,holdenk/spark,cloud-fan/spark,vinodkc/spark,HyukjinKwon/spark,witgo/spark,maropu/spark,hvanhovell/spark,taroplus/spark,ueshin/apache-spark,BryanCutler/spark,dongjoon-hyun/spark,nchammas/spark,dongjoon-hyun/spark,xuanyuanking/spark,wangyum/spark,zzcclp/spark,dongjoon-hyun/spark,ueshin/apache-spark,BryanCutler/spark,dongjoon-hyun/spark,milliman/spark,rednaxelafx/apache-spark,hvanhovell/spark,BryanCutler/spark,holdenk/spark,WeichenXu123/spark,vinodkc/spark,witgo/spark,witgo/spark,HyukjinKwon/spark,wangyum/spark,HyukjinKwon/spark,hvanhovell/spark,vinodkc/spark,witgo/spark,apache/spark,HyukjinKwon/spark,mahak/spark,WeichenXu123/spark,nchammas/spark,gengliangwang/spark,chuckchen/spark,wangyum/spark,maropu/spark,xuanyuanking/spark,HyukjinKwon/spark,chuckchen/spark,wangmiao1981/spark,mahak/spark,hvanhovell/spark,jiangxb1987/spark,vinodkc/spark,vinodkc/spark,holdenk/spark,holdenk/spark,maropu/spark,JoshRosen/spark,rednaxelafx/apache-spark,rednaxelafx/apache-spark,cloud-fan/spark,milliman/spark,apache/spark,dongjoon-hyun/spark,xuanyuanking/spark,jiangxb1987/spark,shaneknapp/spark,taroplus/spark,apache/spark,srowen/spark,witgo/spark,WeichenXu123/spark,gengliangwang/spark,taroplus/spark,wangyum/spark,taroplus/spark,milliman/spark,mahak/spark,shaneknapp/spark,wangmiao1981/spark,BryanCutler/spark,zzcclp/spark,srowen/spark,nchammas/spark,nchammas/spark,holdenk/spark,gengliangwang/spark,shaneknapp/spark,mahak/spark,zero323/spark,mahak/spark,chuckchen/spark,chuckchen/spark,zzcclp/spark,jiangxb1987/spark,wangyum/spark,zero323/spark,xuanyuanking/spark,zzcclp/spark,BryanCutler/spark,srowen/spark,rednaxelafx/apache-spark,gengliangwang/spark,rednaxelafx/apache-spark,wangmiao1981/spark,nchammas/spark,WeichenXu123/spark,BryanCutler/spark,jiangxb1987/spark,wangyum/spark,wangmiao1981/spark,zero323/spark,milliman/spark,JoshRosen/spark,mahak/spark,WeichenXu123/spark,JoshRosen/spark,apache/spark,mahak/spark,maropu/spark,cloud-fan/spark,hvanhovell/spark,JoshRosen/spark,cloud-fan/spark,ueshin/apache-spark,wangyum/spark,apache/spark,ueshin/apache-spark,xuanyuanking/spark,shaneknapp/spark,taroplus/spark,zero323/spark,hvanhovell/spark,jiangxb1987/spark,maropu/spark,chuckchen/spark,witgo/spark,gengliangwang/spark,holdenk/spark,vinodkc/spark,wangmiao1981/spark,taroplus/spark,apache/spark,milliman/spark,zero323/spark,WeichenXu123/spark,ueshin/apache-spark,rednaxelafx/apache-spark,zero323/spark,witgo/spark,BryanCutler/spark,xuanyuanking/spark,jiangxb1987/spark,HyukjinKwon/spark,taroplus/spark,JoshRosen/spark,srowen/spark,HyukjinKwon/spark,nchammas/spark,xuanyuanking/spark,shaneknapp/spark,hvanhovell/spark