Time difference between button clicked and the first line in the invoked function

@Gopi_M

Some ideas (without the benefit of a minimal reproducible example) …

  1. Rework your callback so that the logic after setting the Div model to visible so all remaining code in the current callback is invoked via a add_next_tick_callback(…)

  2. Use panel at the top-level of your code … it can be used as a thin wrapper to bokeh and the panel server is the bokeh server. Panel includes a LoadingSpinner widget that can indicate busy state.

    https://panel.holoviz.org/reference/indicators/LoadingSpinner.html

Regarding 1, I think what might be happening is similar to the behavior discussed in this Discourse topic.

https://discourse.bokeh.org/t/div-not-updating-immediately/4134