# Separation of declaration and initiation of variables

**URL:** <https://fortran-lang.discourse.group/t/separation-of-declaration-and-initiation-of-variables/3685>\
**Category:** Help\
**Created:** [June 7, 2022, 2:21am UTC](https://fortran-lang.discourse.group/t/separation-of-declaration-and-initiation-of-variables/3685 "2022-06-07T02:21:57Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [June 9, 2022, 3:43pm UTC](https://fortran-lang.discourse.group/t/separation-of-declaration-and-initiation-of-variables/3685/29 "2022-06-09T15:43:45Z")

</div>

> [@jacobwilliams](#):
>
> … Any time it seems like something needs a global state like that is a clue that it probably should be a class.

Re: “probably should be a class,” - aka a derived type in Fortran parlance.

And there have been many illustrations of that online generally and with Fortran including at this forum, see [**here**](https://fortran-lang.discourse.group/t/speed-of-atoi-and-atof-vs-internal-read/3375/13).

With this, a simple timing “instrumentation” becomes

```fortran
   call timer%start()
   .. ! some instructions here  
   call timer%stop()
   ! the "delta seconds" are fetched via timer%t()
   print *, timer%t()

```

Bottom-line here: **no** `SAVE` variables needed with this. Such a “timer” type can then also be used in codes which are not the traditional sequential/serial execution ones.

---

_[View the full topic](https://fortran-lang.discourse.group/t/separation-of-declaration-and-initiation-of-variables/3685)._
