`stdTimer` - Cache remote workbook
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- performance, tooling
Línea de trabajo
Start by tracing the existing stdTimer implementation and its workbook usage. Review the proposed AddTimer, MainLoop, OnChange, and Tick flow, including how callbacks would be looked up by id. Done means multiple timers share one cached workbook, callbacks remain distinct, and the timer loop still handles different intervals.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Currently our code uses 1 workbook per timer, which is crazy slow. This is currently declared as "not really an issue" because requiring more than 1 timer is likely rare(?).
However if a work around was desired we could instead:
- Cache the workbook
- Use the
AddTimer()method of below:
Private Type Timer
current as long
frequency as long
id as string
End Type
Private Timers() as Timer
Private Const MAX_TIME as Long = 1000000
Private Const MIN_TIME as Long = 10
Sub AddTimer(ByVal iMilliseconds as long, ByVal id as string)
if iMilliseconds > MAX_TIME then iMilliseconds = MAX_TIME
if iMilliseconds < MIN_TIME then iMilliseconds = MIN_TIME
On Error Resume Next: iNext = ubound(Timers)+1: On Error GoTo 0
Redim Timers(0 to iNext)
With Timers(iNext)
Timers.current = 0
Timers.frequency = iMilliseconds
Timers.id= id
End With
End Sub
Sub MainLoop()
set r = Sheet1.Cells(1,1)
While True
For each timer in Timers
timer.current = timer.current + 1
if timer.current mod timer.frequency = 0 then
r.Value = id
timer.current = 0 'saves having to deal with overflows
end if
next
Doevents
Sleep 1
Wend
End Sub
OnChangeuse theid = Target.Valueand lookupidin a dictionary to find callback. Also pass id to Tick event.
This can handle multiple timers each added at different times. Unfortunately as new timers are added the whole class slows down, but perhaps this is ok.
- Lenguaje dominante
- VBA
- Estrellas
- 412
- Forks
- 70
- Merge medio
- 16 h 10 min
- PR fusionados (30 d)
- 3
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sancarn/stdVBA
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
-
Issues of stdRefArrayAbiertoenhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Todos los issues de sancarn/stdVBA
Issues similares
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
3.0.0-M*: every channel stays reachable from its session's KEX listeners, so a long-lived session leaks all closed channelsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OpenMathLib/OpenBLAS#6192 ·
Los mantenedores suelen responder en 1 día
-
Edge children regression test from #797 has a 2x margin under llvm-cov and passes under --releaseAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tox-dev/pipdeptree#840 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
mollie/PrestaShop#1600 · 1 comentario ·
Los mantenedores suelen responder en 9 días