// Howdy ๐.
//
// If you are new to writing code in Flux make sure to check out our get started docs: https://docs.flux.ai/write-code
//
// We also have a Flux Slack Community in case you need help: https://join.slack.com/t/fluxcommunity/shared_invite/zt-p48n941f-wzQ06kGmuFJ2HXnGYT1JkA
//
// To infinity and beyond ๐
flux.on("setup", () => {
// Simulator is ready to start
// This is a good place to get your model ready
});
flux.on("beforeStep", () => {
// This event will fire just before the simulator computes the current step
// This is a great place to set variables on your primitives
});
let time = 0;
let lastCheck = 0;
flux.on("afterStep", (event) => {
// This event fires right after the simulator computed the curret step
// It's a great place to grab your output voltages/current and do something with them
time += event.time_since_last_step
if(time-lastCheck > 1000){
console.log(time)
lastCheck = time;
}
//console.log('step'+time)
});