# How to get t (time) to calculate output = sin ( 2 \* PI \* freq \* t )?

**URL:** <https://www.ruby-forum.com/t/how-to-get-t-time-to-calculate-output-sin-2-pi-freq-t/239056>\
**Category:** GNU Radio\
**Created:** [February 10, 2014, 2:19pm UTC](https://www.ruby-forum.com/t/how-to-get-t-time-to-calculate-output-sin-2-pi-freq-t/239056 "2014-02-10T14:19:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [February 10, 2014, 2:19pm UTC](https://www.ruby-forum.com/t/how-to-get-t-time-to-calculate-output-sin-2-pi-freq-t/239056/1 "2014-02-10T14:19:26Z")

</div>

Dear Sir,

I am building a custom block.  
How to know the time t, in seconds, of how long the flow graph has  
started?

Says, I build a block of analog\_sig\_source\_f.  
Its work() function may involve a variable t (time) as below:

```
 for ( int i=0; i < noutput_items; i++ ) {
    out[i] = ampl * sin( 2 * PI * wave_freq * t )
 }

```

I know we there is a built-in Signal Source block, but I write this to  
illustrate what I need to do.

Regards,  
activecat
