# Most used ic\_cdk functions

**URL:** https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854
**Category:** Rust
**Created:** [April 15, 2025, 7:32am UTC](https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854 "2025-04-15T07:32:53Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)
#### Post date: [April 15, 2025, 7:32am UTC](https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854/1 "2025-04-15T07:32:53Z")

</div>

Not sure if there are any metrics on this, but I was wondering: what functions do you use the most from `ic_cdk` in your projects?

I’m guessing the following comes often in your codebase:

- `caller()`
- `id()`
- `call()`
- `time()`

Any other functions?

Asking for a friend who’s building something that’s not that [secret](https://juno.build/docs/reference/functions/typescript) anymore 😉

---

<div class="post-metadata">

### Author: ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)
#### Post date: [April 16, 2025, 10:17am UTC](https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854/2 "2025-04-16T10:17:28Z")

</div>

Cycles ledger:

- `time()`: all over the place
- `caller()`: a bit less, but still a lot
- `call()`: not at all, but we use `call_with_payment128()` a few times
- `id()`: never. I even looked up what it does just to double-check 🙂

---

<div class="post-metadata">

### Author: ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)
#### Post date: [April 16, 2025, 10:41am UTC](https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854/3 "2025-04-16T10:41:35Z")

</div>

Thanks a lot for the feedback, Severin! It confirms `time()` is the next one I should tackle.

Funny enough, I use `id()` quite a bit since it basically acts like admin privileges in my serverless functions.

If any other functions come to mind, feel free to share!

---

<div class="post-metadata">

### Author: ![C-B-Elite](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/c-b-elite/32/34356_2.png) [@C-B-Elite](https://forum.dfinity.org/u/C-B-Elite)
#### Post date: [April 17, 2025, 3:03am UTC](https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854/4 "2025-04-17T03:03:17Z")

</div>

In my code, there’s no doubt that `caller()` is used the most, since it’s heavily involved in access control.  
In places where there’s a lot of state management involved, I find `trap()` more convenient than restoring the state step by step 🤣

---

<div class="post-metadata">

### Author: ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)
#### Post date: [April 17, 2025, 4:56am UTC](https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854/5 "2025-04-17T04:56:12Z")

</div>

Absolutely, `caller()` will definitely be useful when I extend support to allow developers to write their own endpoints (which they can already do in Rust, but not in the first iteration of the TypeScript support I’m currently wrapping up).

I also use `trap()` for convenience, and I’ll need to add it in the same context — good point. 👍

Thanks for the feedback!

---

<div class="post-metadata">

### Author: ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)
#### Post date: [April 19, 2025, 2:41pm UTC](https://forum.dfinity.org/t/most-used-ic-cdk-functions/43854/6 "2025-04-19T14:41:42Z")

</div>

✅ `id()`  
✅ `call()`  
✅ `time()`  
✅ `print()` (used within `console.log`)

That should do for a first version (on top of Juno’s SDK features).

> **[IC-CDK | Juno](https://juno.build/docs/reference/functions/typescript/ic-cdk)**
>
> Juno exposes a growing set of these features for TypeScript, allowing you to build serverless functions that interact with the IC using a familiar developer experience.
