# Typescript "Call by Reference"

**URL:** https://forum.makecode.com/t/typescript-call-by-reference/12745
**Category:** PXT
**Created:** [March 17, 2022, 4:50pm UTC](https://forum.makecode.com/t/typescript-call-by-reference/12745 "2022-03-17T16:50:57Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tschanni](https://avatars.discourse-cdn.com/v4/letter/t/ecae2f/32.png) [@tschanni](https://forum.makecode.com/u/tschanni)
#### Post date: [March 17, 2022, 4:50pm UTC](https://forum.makecode.com/t/typescript-call-by-reference/12745/1 "2022-03-17T16:50:57Z")

</div>

Hi there,

Im new to this whole MakeCode Enviroment and im trying to build my own block which, for example, should just measure the time a process needs.  
So I did a Bracket block and declared it like the following:

/\*\*  
\* Get Cycle time  
\*/  
//% block=“Cycle time obj $time”  
//% inlineInputMode=inline  
//% handlerStatement=1  
//% group=“Time”  
export function getCycleTime(time: any,body: () =\> void): void {  
time = //here are some operations for the function the block should have  
body();  
}

so now I got the problem that I cant give the function the reference of my variable in typescript and I cant pass it as a Object or Array.  
Is there a chance to pass the variable as a reference or declare a static variable for the block that I can use afterwards ?

Hope someone can help me 😵
