# How do I move the slider from one time point to another and measure the time it takes to redraw an image?

**URL:** <https://discourse.julialang.org/t/how-do-i-move-the-slider-from-one-time-point-to-another-and-measure-the-time-it-takes-to-redraw-an-image/94232>\
**Category:** Visualization\
**Created:** [February 7, 2023, 7:59pm UTC](https://discourse.julialang.org/t/how-do-i-move-the-slider-from-one-time-point-to-another-and-measure-the-time-it-takes-to-redraw-an-image/94232 "2023-02-07T19:59:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vladdez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vladdez/32/45806_2.png) [@vladdez](https://discourse.julialang.org/u/vladdez)\
**Post date:** [February 7, 2023, 7:59pm UTC](https://discourse.julialang.org/t/how-do-i-move-the-slider-from-one-time-point-to-another-and-measure-the-time-it-takes-to-redraw-an-image/94232/1 "2023-02-07T19:59:54Z")

</div>

I would like to benchmark interactive topoplot. More specifically, measure the time between drawing topoplot with one time point on the slider and another.  
I tried several times, but failed. For now, I want it to at least move the slider from one point to another. Do you have any ideas?

```julia
function interactive_topo_function() 
    data, pos = TopoPlots.example_data()
    N = 1:length(pos)
    f = Figure()
    xs = range(0, length=size(data, 2), step=1 ./ 100) 
    sg = SliderGrid(f[2, 1],
        (label = "time", range = xs, format = "{:.3f} ms", startvalue = 0.02),
    )
    time = sg.sliders[1].value
    
    topo_slice = lift((t, data) -> mean(data[:, indexin(t, xs), :], dims=2)[:,1], time, data)
    topo_axis = Axis(f[1, 1], aspect = DataAspect(), title = "Interactive topoplot")
    topo = eeg_topoplot!(topo_axis, topo_slice,
        N,
        positions=pos,
        enlarge=1.2,
        markersize = 10,
        lablesize = 10) 
    str = lift(t -> "[$(round(t, digits = 3)) ms]", time)
    text!(topo_axis, 1, 1, text = str, align = (:center, :center))

    hidedecorations!(topo_axis)
    hidespines!(topo_axis) 

    sg.sliders[1].value.val = 3.96
    notify(sg.sliders[1].value)

    f

end
#@benchmark 
#@time 
interactive_topo_function()

```
