# \#user-function

**URL:** https://brian.discourse.group/tag/user-function/18.md

[Latest](https://brian.discourse.group/latest.md) · [Categories](https://brian.discourse.group/categories.md) · [Tags](https://brian.discourse.group/tags.md)

---

## [How to compute the time-average values on the fly?](https://brian.discourse.group/t/how-to-compute-the-time-average-values-on-the-fly/1356)

<div class="topic-metadata">

**Author:** [@Jasmine9691](https://brian.discourse.group/u/Jasmine9691)\
**Replies:** 8\
**Last updated:** [24 March 2025 05:18 UTC](https://brian.discourse.group/t/how-to-compute-the-time-average-values-on-the-fly/1356 "2025-03-24T05:18:01Z")

</div>

Description of problem For the time being, Brian2 is able to compute the population averages. But what I want is the average values over time. The simplest way is to monitor the states every timestep. However, in my simu…

---

## [User-defined C++ function to work with brian2cuda](https://brian.discourse.group/t/user-defined-c-function-to-work-with-brian2cuda/1116)

<div class="topic-metadata">

**Author:** [@pabloabur](https://brian.discourse.group/u/pabloabur)\
**Replies:** 3\
**Last updated:** [23 January 2024 10:36 UTC](https://brian.discourse.group/t/user-defined-c-function-to-work-with-brian2cuda/1116 "2024-01-23T10:36:18Z")

</div>

Hi, I have this C++ function that I have been using on my standalone mode simulations. Is there an easy way to slightly change it and use it with brian2cuda? I was hoping that it could be as simple as adding \_\_host\_\_ \_\_…

---

## [User-provided function in run\_regularly](https://brian.discourse.group/t/user-provided-function-in-run-regularly/741)

<div class="topic-metadata">

**Author:** [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Replies:** 12\
**Last updated:** [21 July 2022 20:14 UTC](https://brian.discourse.group/t/user-provided-function-in-run-regularly/741 "2022-07-21T20:14:35Z")

</div>

Hi Marcel I have problem compiling the following example code in standalone mode. Any hints would be appreciated. from brian2 import \* set\_device('cpp\_standalone', directory='standalone') @implementation('cpp',…
